commands.sh

lsns

linux

List information about all namespaces or about the specified namespace.

More info →

Options (4)

-J, --jsonboolean

List namespaces in JSON format

Example: lsns {{[-J|--json]}}
-p, --taskboolean

List namespaces associated with the specified process

Example: lsns {{[-p|--task]}} {{pid}}
-t, --typeboolean

List the specified type of namespaces only

Example: lsns {{[-t|--type]}} {{mnt|net|ipc|user|pid|uts|cgroup|time}}
-o, --outputboolean

List namespaces, only showing the namespace ID, type, PID, and command

Example: lsns {{[-o|--output]}} {{NS,TYPE,PID,COMMAND}}

Examples (5)

List all namespaces

List namespaces in JSON format

lsns [-J|--json]

List namespaces associated with the specified process

lsns [-p|--task] pid

List the specified type of namespaces only

lsns [-t|--type] mnt|net|ipc|user|pid|uts|cgroup|time

List namespaces, only showing the namespace ID, type, PID, and command

lsns [-o|--output] NS,TYPE,PID,COMMAND
made by @shridhargupta | data from tldr-pages