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 TYPEParameters & Attributes
| Name | Type | Description |
|---|---|---|
| -p | option | Select process |
| -n | option | Omit headings |
| -o | option | Select output columns |
| PID | operand | Own 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