{
    "mode": "man",
    "parameter": "lsns",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/lsns/8/json",
    "generated": "2026-05-30T06:10:37Z",
    "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 columns by using the --output\noption together with a columns list in environments where a stable 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 --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": "-V --version",
                    "content": "Display version information and exit.\n",
                    "flag": "-V",
                    "long": "--version"
                },
                {
                    "name": "-h --help",
                    "content": "Display help text and exit.\n",
                    "flag": "-h",
                    "long": "--help"
                }
            ]
        },
        "AUTHORS": {
            "content": "Karel Zak <kzak@redhat.com>\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "nsenter(1), unshare(1), clone(2), namespaces(7), ioctlns(2)\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "For bug reports, use the issue tracker at https://github.com/karelzak/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\n\n\nutil-linux 2.37.2                            2021-08-16                                      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": "--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": "-V",
            "long": "--version",
            "arg": null,
            "description": "Display version information and exit."
        },
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Display help text 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"
        }
    ]
}