Forrest logo
back to the lsns tool

lsns:tldr:b8d2d

lsns: List the specified type of namespaces only.
$ lsns --type
try on your machine

The lsns command lists namespaces on a Linux system. A namespace is a mechanism for isolating and providing process-level virtualization within the kernel. It allows multiple instances of the same global resource to exist separately, providing process-level isolation.

The --type option is used to filter the list of namespaces by a specific type. Here are some possible values for the --type parameter:

  1. mnt: This lists the mount namespaces. A mount namespace provides an isolated view of the file system mount points. It allows each process or group of processes to have its own mount points and not see the mount points of other processes.

  2. net: This lists the network namespaces. A network namespace provides an isolated network stack, including network devices, IP addresses, routing tables, and firewall rules. Each network namespace can have different networking configurations.

  3. ipc: This lists the IPC (Inter-Process Communication) namespaces. An IPC namespace provides an isolated environment for inter-process communication mechanisms, such as system V IPC or POSIX message queues.

  4. user: This lists the user namespaces. A user namespace provides process-level isolation for user and group identifiers. It allows processes to have their own unique set of user and group IDs separate from the host system.

  5. pid: This lists the PID namespaces. A PID namespace isolates the process ID numbering. It allows processes within the namespace to have their own set of process IDs that might not correspond to the IDs used in other namespaces.

  6. uts: This lists the UTS (Unix Time Sharing) namespaces. A UTS namespace isolates the hostname and domain name.

  7. cgroup: This lists the cgroup namespaces. A cgroup namespace isolates the view of control groups, which are used for resource allocation and management.

  8. time: This lists the time namespaces. A time namespace isolates the system time from other namespaces.

By specifying one of these types, the lsns command displays only the namespaces of that specific type, allowing for better filtering and comprehension of the namespace hierarchy on the system.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the lsns tool