commands

lsns — List accessible namespaces

List namespaces visible through procfs. Restrict inspection to your own shell; permissions and procfs visibility limit results. Use a fresh private workspace; No production workload is required.

Formal Syntax & Structure

linux syntaxlinux
lsns -p PID -n -o TYPE

Parameters & Attributes

NameTypeDescription
-poptionSelect process
-noptionOmit headings
-ooptionSelect output columns
PIDoperandOwn shell process ID

Return Value

exit status and output

Prints namespace types visible for the selected PID. An absent row can reflect procfs visibility or process lifetime; a successful listing does not establish isolation strength.

Working Example

Example Snippetlinux
lsns -p "$$" -n -o TYPE | grep -x mnt
Linux Reference