{
    "mode": "man",
    "parameter": "lsns",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/lsns/8/json",
    "generated": "2026-10-04T13:26:15Z",
    "synopsis": "lsns [options] namespace",
    "sections": {
        "NAME": {
            "content": "lsns - list namespaces\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "lsns [options] namespace\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "lsns lists information about all the currently accessible namespaces or about the given\nnamespace. The namespace identifier is an inode number.\n\nThe default output is subject to change. So whenever possible, you should avoid using default\noutputs in your scripts. Always explicitly define expected output mode (--tree or --list) and\ncolumns by using the --output option together with a columns list in environments where a\nstable output is required.\n\nThe NSFS column, printed when net is specified for the --type option, is special; it uses\nmulti-line cells. Use the option --nowrap to switch to \",\"-separated single-line\nrepresentation.\n\nNote that lsns reads information directly from the /proc filesystem and for non-root users it\nmay return incomplete information. The current /proc filesystem may be unshared and affected\nby a PID namespace (see unshare --mount-proc for more details). lsns is not able to see\npersistent namespaces without processes where the namespace instance is held by a bind mount\nto /proc/pid/ns/type.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-J --json",
                    "content": "Use JSON output format.\n",
                    "flag": "-J",
                    "long": "--json"
                },
                {
                    "name": "-l --list",
                    "content": "Use list output format.\n",
                    "flag": "-l",
                    "long": "--list"
                },
                {
                    "name": "-n --noheadings",
                    "content": "Do not print a header line.\n",
                    "flag": "-n",
                    "long": "--noheadings"
                },
                {
                    "name": "-o --output _",
                    "content": "Specify which output columns to print. Use --help to get a list of all supported columns.\n\nThe default list of columns may be extended if list is specified in the format +list\n(e.g., lsns -o +PATH).\n",
                    "flag": "-o",
                    "long": "--output"
                },
                {
                    "name": "--output-all",
                    "content": "Output all available columns.\n",
                    "long": "--output-all"
                },
                {
                    "name": "-P --persistent",
                    "content": "Display only the namespaces without processes (aka persistent namespaces), created by\nbind mounting /proc/pid/ns/type files to a filesystem path.\n",
                    "flag": "-P",
                    "long": "--persistent"
                },
                {
                    "name": "-p --task _",
                    "content": "Display only the namespaces held by the process with this PID.\n",
                    "flag": "-p",
                    "long": "--task"
                },
                {
                    "name": "-r --raw",
                    "content": "Use the raw output format.\n",
                    "flag": "-r",
                    "long": "--raw"
                },
                {
                    "name": "-t --type _",
                    "content": "Display the specified type of namespaces only. The supported types are mnt, net, ipc,\nuser, pid, uts, cgroup and time. This option may be given more than once.\n",
                    "flag": "-t",
                    "long": "--type"
                },
                {
                    "name": "-u --notruncate",
                    "content": "Do not truncate text in columns.\n",
                    "flag": "-u",
                    "long": "--notruncate"
                },
                {
                    "name": "-W --nowrap",
                    "content": "Do not use multi-line text in columns.\n",
                    "flag": "-W",
                    "long": "--nowrap"
                },
                {
                    "name": "-T --tree _",
                    "content": "Use tree-like output format. If process is given as rel, print process tree(s) in each\nname space. This is default when --tree is not specified. If parent is given, print\ntree(s) constructed by the parent/child relationship. If owner is given, print tree(s)\nconstructed by the owner/owned relationship. owner is used as default when rel is\nomitted.\n",
                    "flag": "-T",
                    "long": "--tree"
                },
                {
                    "name": "-h --help",
                    "content": "Display help text and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "-V --version",
                    "content": "Print version and exit.\n",
                    "flag": "-V",
                    "long": "--version"
                }
            ]
        },
        "EXIT STATUS": {
            "content": "The lsns utility exits with one of the following values:\n\n0\nSuccess.\n\n1\nGeneral error.\n\n2\nAn ioctl was unknown to the kernel.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Karel Zak <kzak@redhat.com>\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "nsenter(1), unshare(1), clone(2), namespaces(7), ioctlns(2), ip-netns(8)\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "For bug reports, use the issue tracker at https://github.com/util-linux/util-linux/issues.\n",
            "subsections": []
        },
        "AVAILABILITY": {
            "content": "The lsns command is part of the util-linux package which can be downloaded from Linux Kernel\nArchive <https://www.kernel.org/pub/linux/utils/util-linux/>.\n\nutil-linux 2.39.3                            2023-11-21                                      LSNS(8)",
            "subsections": []
        }
    },
    "summary": "lsns - list namespaces",
    "flags": [
        {
            "flag": "-J",
            "long": "--json",
            "arg": null,
            "description": "Use JSON output format."
        },
        {
            "flag": "-l",
            "long": "--list",
            "arg": null,
            "description": "Use list output format."
        },
        {
            "flag": "-n",
            "long": "--noheadings",
            "arg": null,
            "description": "Do not print a header line."
        },
        {
            "flag": "-o",
            "long": "--output",
            "arg": null,
            "description": "Specify which output columns to print. Use --help to get a list of all supported columns. The default list of columns may be extended if list is specified in the format +list (e.g., lsns -o +PATH)."
        },
        {
            "flag": "",
            "long": "--output-all",
            "arg": null,
            "description": "Output all available columns."
        },
        {
            "flag": "-P",
            "long": "--persistent",
            "arg": null,
            "description": "Display only the namespaces without processes (aka persistent namespaces), created by bind mounting /proc/pid/ns/type files to a filesystem path."
        },
        {
            "flag": "-p",
            "long": "--task",
            "arg": null,
            "description": "Display only the namespaces held by the process with this PID."
        },
        {
            "flag": "-r",
            "long": "--raw",
            "arg": null,
            "description": "Use the raw output format."
        },
        {
            "flag": "-t",
            "long": "--type",
            "arg": null,
            "description": "Display the specified type of namespaces only. The supported types are mnt, net, ipc, user, pid, uts, cgroup and time. This option may be given more than once."
        },
        {
            "flag": "-u",
            "long": "--notruncate",
            "arg": null,
            "description": "Do not truncate text in columns."
        },
        {
            "flag": "-W",
            "long": "--nowrap",
            "arg": null,
            "description": "Do not use multi-line text in columns."
        },
        {
            "flag": "-T",
            "long": "--tree",
            "arg": null,
            "description": "Use tree-like output format. If process is given as rel, print process tree(s) in each name space. This is default when --tree is not specified. If parent is given, print tree(s) constructed by the parent/child relationship. If owner is given, print tree(s) constructed by the owner/owned relationship. owner is used as default when rel is omitted."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Display help text and exit."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Print version and exit."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "nsenter",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/nsenter/1/json"
        },
        {
            "name": "unshare",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/unshare/1/json"
        },
        {
            "name": "clone",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/clone/2/json"
        },
        {
            "name": "namespaces",
            "section": "7",
            "url": "https://www.chedong.com/phpMan.php/man/namespaces/7/json"
        },
        {
            "name": "ioctlns",
            "section": "2",
            "url": "https://www.chedong.com/phpMan.php/man/ioctlns/2/json"
        },
        {
            "name": "ip-netns",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-netns/8/json"
        }
    ]
}