table of contents
- bookworm 2.38.1-5+deb12u3
- testing 2.40.4-5
- unstable 2.40.4-5
- experimental 2.41-2
LSNS(8) | System Administration | LSNS(8) |
NAME¶
lsns - list namespaces
SYNOPSIS¶
lsns [options] [namespace]
DESCRIPTION¶
lsns lists information about all the currently accessible namespaces or about the given namespace. The namespace identifier is an inode number.
The default output is subject to change. So whenever possible, you should avoid using default outputs in your scripts. Always explicitly define expected output mode (--tree or --list) and columns by using the --output option together with a columns list in environments where a stable output is required.
The NSFS column, printed when net is specified for the --type option, is special; it uses multi-line cells. Use the option --nowrap to switch to ","-separated single-line representation.
Note that lsns reads information directly from the /proc filesystem and for non-root users it may return incomplete information. The current /proc filesystem may be unshared and affected by a PID namespace (see unshare --mount-proc for more details). lsns is not able to see persistent namespaces without processes where the namespace instance is held by a bind mount to /proc/pid/ns/type.
OPTIONS¶
-H, --list-columns
-J, --json
-l, --list
-n, --noheadings
-o, --output list
The default list of columns may be extended if list is specified in the format +list (e.g., lsns -o +PATH).
--output-all
-P, --persistent
-p, --task PID
-Q, --filter expr
This feature is EXPERIMENTAL. See also scols-filter(5). For example exclude root as username, but print every namespaces more than one process belongs to:
lsns --filter 'USER != "root" and NPROCS > 1'
-r, --raw
-t, --type type
-u, --notruncate
-W, --nowrap
-T, --tree[=rel]
-h, --help
-V, --version
EXIT STATUS¶
The lsns utility exits with one of the following values:
0
1
2
ENVIRONMENT¶
LSNS_DEBUG=all
AUTHORS¶
Karel Zak <kzak@redhat.com>
SEE ALSO¶
nsenter(1), unshare(1), clone(2), namespaces(7), ioctl_ns(2), ip-netns(8) scols-filter(5)
REPORTING BUGS¶
For bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>.
AVAILABILITY¶
The lsns command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.
2025-02-26 | util-linux 2.41 |