namespace (Linux)

A Linux kernel feature that controls what a process can see, such as which other processes, network or host name.

In more detail

Linux has eight kinds of namespace: cgroup, IPC, mount, network, PID, time, user and UTS. Every process is in one namespace of each kind, and two processes see each other through a namespace only if they share its identifier, the number shown in square brackets under /proc/self/ns. Docker gives each container fresh namespaces; flags like --pid=host hand one back to the host. Namespaces hide things but do not create a second kernel. Not the same as an image namespace, which is part of an image name.

Examples

ls /proc/self/ns
readlink /proc/self/ns/pid   # pid:[4026532211]

Related terms

Taught in

References