LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

lxc-ls

lists Linux containers on the system

TLDR

List all containers
$ sudo lxc-ls
copy
List active containers
$ sudo lxc-ls --active
copy
List frozen containers
$ sudo lxc-ls --frozen
copy
List stopped containers
$ sudo lxc-ls --stopped
copy
List with fancy output
$ sudo lxc-ls --fancy
copy
List with custom fancy columns
$ sudo lxc-ls --fancy -F [NAME,STATE,IPV4,IPV6]
copy
List containers matching a regex filter
$ sudo lxc-ls --filter ['^web.*']
copy

SYNOPSIS

lxc-ls [options]

DESCRIPTION

lxc-ls lists Linux containers on the system. It can filter by state and display detailed information in various formats.

PARAMETERS

--active

Show running and frozen containers
--frozen
Show only frozen containers
--running
Show only running containers
--stopped
Show only stopped containers
-f, --fancy
Column-formatted detailed output
-F, --fancy-format COLS
Custom columns for fancy output
-1
One container per line
--filter regex
Filter container names by regular expression
-?, --help
Display help information

FANCY OUTPUT COLUMNS

NAME, STATE, AUTOSTART, GROUPS, IPV4, IPV6, UNPRIVILEGED

CAVEATS

Requires root or appropriate LXC permissions for system containers. Unprivileged containers can be listed without root if configured for the current user.

SEE ALSO

Copied to clipboard
Kai