lxc-ls(1)

πŸ’… lxc-ls β€” the container list command, bestie

Okay so picture this: you've got containers. Maybe a lot. Maybe too many. And you're like "girl, what is even ON this system right now?" That's lxc-ls, and she's about to give you the whole roster. This is the lxc-ls(1) manual page, rewritten so you actually enjoy reading it. No cap. 🫢


✨ NAME ✨

lxc-ls β€” list the containers existing on the system

Like, all of them. Or some of them. Depends on your flags. We'll get there. πŸ¦‹


🌸 SYNOPSIS 🌸

lxc-ls [-1] [--active] [--frozen] [--running] [--stopped] [--defined]
       [-f] [-F format] [-g groups] [--nesting=NUM] [--filter=regex]

That's the whole vibe check in one block. Don't worry, we're breaking it down. πŸ’–


πŸ‘‘ DESCRIPTION πŸ‘‘

lxc-ls lists the containers existing on the system. That's it. That's the whole job. But she does it so well. Periodt. πŸ”₯


πŸŽ€ OPTIONS πŸŽ€

Okay bestie, here's where it gets juicy. Every single flag, explained with love.

  • -1 β€” Show one entry per line. (This is the default when /dev/stdout isn't a tty, FYI. So like, if you're piping it somewhere, she already knows. Iconic.) ⭐
  • --active β€” List only active containers. And yes, that's the same as --frozen --running together. Two moods, one flag. πŸ’«
  • --frozen β€” List only frozen containers. The ones just… chillin'. Literally. πŸ₯Ά
  • --running β€” List only running containers. The main characters. πŸ‘‘
  • --stopped β€” List only stopped containers. They're resting. Respect it. 😴
  • --defined β€” List only defined containers. They exist on paper, bestie. That counts. πŸ“
  • -f, --fancy β€” Use a fancy, column-based output. She ate and left no crumbs. πŸ’…
  • -F, --fancy-format format β€” Comma separated list of columns to show in the fancy output. The list of accepted and default fields is listed in --help. So like, go check --help if you wanna know your options, babe. 🌈
  • -g, --groups groups β€” Comma separated list of groups the container must have to be displayed. And guess what? You can pass this parameter multiple times. Lowkey flexible. 🧚
  • --nesting=NUM β€” Show nested containers. The number of nesting levels to be shown can be specified by passing a number as argument. It's giving inception. πŸŒ€
  • --filter=regex β€” The regular expression passed to lxc-ls will be applied to the container name. The format is a POSIX extended regular expression. It can also be given as additional argument without explicitly using --filter. So you can just toss it in there, no announcement needed. πŸ™ˆ

πŸ’– EXAMPLES πŸ’–

Let's see her in action, shall we?

lxc-ls --fancy

List all the containers, listing one per line along with its name, state, ipv4 and ipv6 addresses. She's thorough. Obsessed. ✨

lxc-ls --active -1

List active containers and display the list in one column. Clean. Simple. Slay. πŸŽ€


🌟 COMMON OPTIONS 🌟

These options are common to most of lxc commands. So like, you'll see them everywhere. Learn them once, use them forever. 🫢

  • -?, -h, --help β€” Print a longer usage message than normal. She's verbose and we love that. πŸ’¬
  • --usage β€” Give the usage message. Short and sweet. πŸ“
  • -q, --quiet β€” Mute on. Shhh. 🀫
  • -P, --lxcpath=PATH β€” Use an alternate container path. The default is /var/lib/lxc. Home sweet home. 🏠
  • -o, --logfile=FILE β€” Output to an alternate log FILE. The default is no log. So if you want receipts, you gotta ask for them. πŸ“„
  • -l, --logpriority=LEVEL β€” Set log priority to LEVEL. The default log priority is ERROR. Possible values are: FATAL, ALERT, CRIT, WARN, ERROR, NOTICE, INFO, DEBUG, TRACE.
Note that this option is setting the priority of the events log in the alternate log file. It do not have effect on the ERROR events log on stderr. (Yes, "it do not" β€” that's the original wording, bestie, I don't make the rules. πŸ’€)
  • -n, --name=NAME β€” Use container identifier NAME. The container identifier format is an alphanumeric string. So like, letters and numbers. Keep it cute. πŸ”€
  • --rcfile=FILE β€” Specify the configuration file to configure the virtualization and isolation functionalities for the container.

This configuration file if present will be used even if there is already a configuration file present in the previously created container (via lxc-create). So yeah, she will override. Be aware. ⚠️

  • --version β€” Show the version number. Flex. πŸ’ͺ

πŸ¦‹ SEE ALSO πŸ¦‹

The whole friend group, honestly. Go check them out:


πŸ“œ HISTORY πŸ“œ

Written originally as a shell script by Daniel Lezcano and Serge Hallyn. Later reimplemented and extended in Python by StΓ©phane Graber and then reimplemented and extended in C by Christian Brauner. Three glow-ups. We love a evolution arc. πŸŒ±β†’πŸŒ³


And that's the tea, bestie! 🍡 This page is from lxc-ls(1), dated 2026-05-01. Go list those containers and live your truth. πŸ’œβœ¨

πŸ“¦ where this page comes from