1LSNS(8) System Administration LSNS(8)
2
3
4
6 lsns - list namespaces
7
9 lsns [options] namespace
10
12 lsns lists information about all the currently accessible namespaces or
13 about the given namespace. The namespace identifier is an inode number.
14
15 The default output is subject to change. So whenever possible, you
16 should avoid using default outputs in your scripts. Always explicitly
17 define expected output mode (--tree or --list) and columns by using the
18 --output option together with a columns list in environments where a
19 stable output is required.
20
21 The NSFS column, printed when net is specified for the --type option,
22 is special; it uses multi-line cells. Use the option --nowrap to switch
23 to ","-separated single-line representation.
24
25 Note that lsns reads information directly from the /proc filesystem and
26 for non-root users it may return incomplete information. The current
27 /proc filesystem may be unshared and affected by a PID namespace (see
28 unshare --mount-proc for more details). lsns is not able to see
29 persistent namespaces without processes where the namespace instance is
30 held by a bind mount to /proc/pid/ns/type.
31
33 -J, --json
34 Use JSON output format.
35
36 -l, --list
37 Use list output format.
38
39 -n, --noheadings
40 Do not print a header line.
41
42 -o, --output list
43 Specify which output columns to print. Use --help to get a list of
44 all supported columns.
45
46 The default list of columns may be extended if list is specified in
47 the format +list (e.g., lsns -o +PATH).
48
49 --output-all
50 Output all available columns.
51
52 -P, --persistent
53 Display only the namespaces without processes (aka persistent
54 namespaces), created by bind mounting /proc/pid/ns/type files to a
55 filesystem path.
56
57 -p, --task PID
58 Display only the namespaces held by the process with this PID.
59
60 -r, --raw
61 Use the raw output format.
62
63 -t, --type type
64 Display the specified type of namespaces only. The supported types
65 are mnt, net, ipc, user, pid, uts, cgroup and time. This option may
66 be given more than once.
67
68 -u, --notruncate
69 Do not truncate text in columns.
70
71 -W, --nowrap
72 Do not use multi-line text in columns.
73
74 -T, --tree rel
75 Use tree-like output format. If process is given as rel, print
76 process tree(s) in each name space. This is default when --tree is
77 not specified. If parent is given, print tree(s) constructed by the
78 parent/child relationship. If owner is given, print tree(s)
79 constructed by the owner/owned relationship. owner is used as
80 default when rel is omitted.
81
82 -h, --help
83 Display help text and exit.
84
85 -V, --version
86 Print version and exit.
87
89 The lsns utility exits with one of the following values:
90
91 0
92 Success.
93
94 1
95 General error.
96
97 2
98 An ioctl was unknown to the kernel.
99
101 Karel Zak <kzak@redhat.com>
102
104 nsenter(1), unshare(1), clone(2), namespaces(7), ioctl_ns(2),
105 ip-netns(8)
106
108 For bug reports, use the issue tracker at
109 https://github.com/util-linux/util-linux/issues.
110
112 The lsns command is part of the util-linux package which can be
113 downloaded from Linux Kernel Archive
114 <https://www.kernel.org/pub/linux/utils/util-linux/>.
115
116
117
118util-linux 2.39.2 2023-06-14 LSNS(8)