← 返回命令列表

Linux command

lsns 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Example

lsns

Example

lsns -J

Example

lsns -p 1234

Example

lsns -t net

Example

lsns -o NS,TYPE,PID,COMMAND

Example

lsns -P

说明

lsns lists information about Linux namespaces. Namespaces provide isolation for various system resources, and this tool displays which namespaces exist and which processes are using them.

参数

-t, --type TYPE
Filter by namespace type (mnt, net, ipc, user, pid, uts, cgroup, time)
-p, --task PID
Show namespaces for specific process
-o, --output LIST
Specify columns to display
-l, --list
Use list output format
-J, --json
Output in JSON format
-r, --raw
Use raw output format
-n, --noheadings
Do not print headers
-u, --notruncate
Do not truncate text in columns
-W, --nowrap
Do not wrap multi-line cells
-P, --persistent
Show only persistent namespaces
-T, --tree REL
Show tree view with specified relationship

FAQ

What is the lsns command used for?

lsns lists information about Linux namespaces. Namespaces provide isolation for various system resources, and this tool displays which namespaces exist and which processes are using them.

How do I run a basic lsns example?

Run `lsns` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -t, --type TYPE do in lsns?

Filter by namespace type (mnt, net, ipc, user, pid, uts, cgroup, time)