# lsns

## NAME



           lsns - list namespaces
    


## SYNOPSIS



           **lsns**[options] [_namespace_]
    


## DESCRIPTION



           **lsns** lists information about all the currently accessible
           namespaces or about the given _namespace_. The _namespace_ identifier
           is an inode number.
    
           The default output is subject to change. So whenever possible, you
           should avoid using default outputs in your scripts. Always
           explicitly define expected output mode (**--tree** or **--list**) and
           columns by using the **--output** option together with a columns list
           in environments where a stable output is required.
    
           The **NSFS** column, printed when **net** is specified for the **--type**
           option, is special; it uses multi-line cells. Use the option
           **--nowrap** to switch to ","-separated single-line representation.
    
           Note that **lsns** reads information directly from the _/proc_
           filesystem and for non-root users it may return incomplete
           information. The current _/proc_ filesystem may be unshared and
           affected by a PID namespace (see **unshare --mount-proc** for more
           details). **lsns** is not able to see persistent namespaces without
           processes where the namespace instance is held by a bind mount to
           /proc/_pid_ /ns/_type_.
    


## OPTIONS



           **-H** , **--list-columns**
               List the columns that can be specified with the **--output**
               option. Can be used with **--json** or **--raw** to get the list in a
               machine-readable format.
    
           **-J** , **--json**
               Use JSON output format.
    
           **-l** , **--list**
               Use list output format.
    
           **-n** , **--noheadings**
               Do not print a header line.
    
           **-o** , **--output** _list_
               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**).
    
           **--output-all**
               Output all available columns.
    
           **-P** , **--persistent**
               Display only the namespaces without processes (aka persistent
               namespaces), created by bind mounting /proc/pid/ns/type files
               to a filesystem path.
    
           **-p** , **--task** _PID_
               Display only the namespaces held by the process with this _PID_.
    
           **-Q** , **--filter** _expr_
               Print only the namespaces that meet the conditions specified
               by the expr.
    
               This feature is EXPERIMENTAL. See also scols-filter(5). For
               example exclude root as username, but print every namespaces
               more than one process belongs to:
    
                  lsns --filter 'USER != "root" and NPROCS > 1'
    
           **-r** , **--raw**
               Use the raw output format.
    
           **-t** , **--type** _type_
               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.
    
           **-u** , **--notruncate**
               Do not truncate text in columns.
    
           **-W** , **--nowrap**
               Do not use multi-line text in columns.
    
           **-T** , **--tree**[**=**_rel_]
               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.
    
           **-h** , **--help**
               Display help text and exit.
    
           **-V** , **--version**
               Display version and exit.
    


## EXIT STATUS



           The **lsns** utility exits with one of the following values:
    
           **0**
               Success.
    
           **1**
               General error.
    
           **2**
               An ioctl was unknown to the kernel.
    


## ENVIRONMENT



           **LSNS_DEBUG** =all
               enables **lsns** debug output.
    


## AVAILABILITY



           The **lsns** command is part of the util-linux package which can be
           downloaded from Linux Kernel Archive
           <https://www.kernel.org/pub/linux/utils/util-linux/>. This page is
           part of the _util-linux_ (a random collection of Linux utilities)
           project. Information about the project can be found at 
           ⟨https://www.kernel.org/pub/linux/utils/util-linux/⟩. If you have a
           bug report for this manual page, send it to
           util-linux@vger.kernel.org. This page was obtained from the
           project's upstream Git repository
           ⟨git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git⟩ on
           2025-08-11. (At that time, the date of the most recent commit that
           was found in the repository was 2025-08-05.) If you discover any
           rendering problems in this HTML version of the page, or you
           believe there is a better or more up-to-date source for the page,
           or you have corrections or improvements to the information in this
           COLOPHON (which is _not_ part of the original manual page), send a
           mail to man-pages@man7.org
    
    util-linux 2.42-start-521-ec46  2025-08-09                        _LSNS_(8)
    


* * *