# man > proc(5)

[_proc_(5)](https://www.chedong.com/phpMan.php/man/proc/5/markdown)                                  File Formats Manual                                 [_proc_(5)](https://www.chedong.com/phpMan.php/man/proc/5/markdown)

## NAME
       proc - process information, system information, and sysctl pseudo-filesystem

## DESCRIPTION
       The  **proc **filesystem is a pseudo-filesystem which provides an interface to kernel data struc‐
       tures.  It is commonly mounted at _/proc_.  Typically, it is mounted automatically by the  sys‐
       tem, but it can also be mounted manually using a command such as:

           mount -t proc proc /proc

       Most of the files in the **proc **filesystem are read-only, but some files are writable, allowing
       kernel variables to be changed.

### Mount options
       The **proc **filesystem supports the following mount options:

       **hidepid**=_n_ (since Linux 3.3)
              This option controls who can access the information in _/proc/_pid directories.  The ar‐
              gument, _n_, is one of the following values:

              0   Everybody may access all _/proc/_pid directories.  This is the traditional behavior,
                  and the default if this mount option is not specified.

              1   Users may not access files and subdirectories inside any _/proc/_pid directories but
                  their  own (the _/proc/_pid directories themselves remain visible).  Sensitive files
                  such as _/proc/_pid_/cmdline_ and _/proc/_pid_/status_ are  now  protected  against  other
                  users.   This  makes it impossible to learn whether any user is running a specific
                  program (so long as the program doesn't otherwise reveal itself by its behavior).

              2   As for mode 1, but in addition the _/proc/_pid directories belonging to other  users
                  become invisible.  This means that _/proc/_pid entries can no longer be used to dis‐
                  cover  the  PIDs  on the system.  This doesn't hide the fact that a process with a
                  specific PID value exists (it can be learned by other means, for example, by "kill
                  -0 $PID"), but it hides a process's UID and GID, which could otherwise be  learned
                  by  employing  [**stat**(2)](https://www.chedong.com/phpMan.php/man/stat/2/markdown)  on a _/proc/_pid directory.  This greatly complicates an at‐
                  tacker's task of gathering information about running processes (e.g.,  discovering
                  whether  some  daemon is running with elevated privileges, whether another user is
                  running some sensitive program, whether other users are  running  any  program  at
                  all, and so on).

       **gid**=_gid_ (since Linux 3.3)
              Specifies  the ID of a group whose members are authorized to learn process information
              otherwise prohibited by **hidepid **(i.e., users in this group behave as though _/proc_  was
              mounted  with  _hidepid=0_).   This  group  should be used instead of approaches such as
              putting nonroot users into the [**sudoers**(5)](https://www.chedong.com/phpMan.php/man/sudoers/5/markdown) file.

### Overview
       Underneath _/proc_, there are the following general groups of files and subdirectories:

       _/proc/_pid subdirectories
              Each one of these subdirectories contains files and subdirectories  exposing  informa‐
              tion about the process with the corresponding process ID.

              Underneath each of the _/proc/_pid directories, a _task_ subdirectory contains subdirecto‐
              ries  of  the form _task/_tid, which contain corresponding information about each of the
              threads in the process, where _tid_ is the kernel thread ID of the thread.

              The _/proc/_pid subdirectories are visible when iterating through _/proc_ with [**getdents**(2)](https://www.chedong.com/phpMan.php/man/getdents/2/markdown)
              (and thus are visible when one uses [**ls**(1)](https://www.chedong.com/phpMan.php/man/ls/1/markdown) to view the contents of _/proc_).

       _/proc/_tid subdirectories
              Each one of these subdirectories contains files and subdirectories  exposing  informa‐
              tion  about the thread with the corresponding thread ID.  The contents of these direc‐
              tories are the same as the corresponding _/proc/_pid_/task/_tid directories.

              The _/proc/_tid subdirectories are _not_ visible when iterating through  _/proc_  with  **get‐**
              [**dents**(2)](https://www.chedong.com/phpMan.php/man/dents/2/markdown) (and thus are _not_ visible when one uses [**ls**(1)](https://www.chedong.com/phpMan.php/man/ls/1/markdown) to view the contents of _/proc_).

       _/proc/self_
              When  a  process  accesses  this magic symbolic link, it resolves to the process's own
              _/proc/_pid directory.

       _/proc/thread-self_
              When a thread accesses this magic symbolic link, it  resolves  to  the  process's  own
              _/proc/self/task/_tid directory.

       _/proc/[a-z]*_
              Various other files and subdirectories under _/proc_ expose system-wide information.

       All of the above are described in more detail below.

## NOTES
       Many  files contain strings (e.g., the environment and command line) that are in the internal
       format, with subfields terminated by null bytes ('\0').  When inspecting such files, you  may
       find that the results are more readable if you use a command of the following form to display
       them:

           $ **cat _**file_ **| tr '\000' '\n'**

## SEE ALSO
       [**cat**(1)](https://www.chedong.com/phpMan.php/man/cat/1/markdown), [**dmesg**(1)](https://www.chedong.com/phpMan.php/man/dmesg/1/markdown), [**find**(1)](https://www.chedong.com/phpMan.php/man/find/1/markdown), [**free**(1)](https://www.chedong.com/phpMan.php/man/free/1/markdown), [**htop**(1)](https://www.chedong.com/phpMan.php/man/htop/1/markdown), [**init**(1)](https://www.chedong.com/phpMan.php/man/init/1/markdown), [**ps**(1)](https://www.chedong.com/phpMan.php/man/ps/1/markdown), [**pstree**(1)](https://www.chedong.com/phpMan.php/man/pstree/1/markdown), [**tr**(1)](https://www.chedong.com/phpMan.php/man/tr/1/markdown), [**uptime**(1)](https://www.chedong.com/phpMan.php/man/uptime/1/markdown), **ch‐**
       [**root**(2)](https://www.chedong.com/phpMan.php/man/root/2/markdown),  [**mmap**(2)](https://www.chedong.com/phpMan.php/man/mmap/2/markdown),  [**readlink**(2)](https://www.chedong.com/phpMan.php/man/readlink/2/markdown),  [**syslog**(2)](https://www.chedong.com/phpMan.php/man/syslog/2/markdown),  [**slabinfo**(5)](https://www.chedong.com/phpMan.php/man/slabinfo/5/markdown),  [**sysfs**(5)](https://www.chedong.com/phpMan.php/man/sysfs/5/markdown), [**hier**(7)](https://www.chedong.com/phpMan.php/man/hier/7/markdown), [**namespaces**(7)](https://www.chedong.com/phpMan.php/man/namespaces/7/markdown),
       [**time**(7)](https://www.chedong.com/phpMan.php/man/time/7/markdown),  [**arp**(8)](https://www.chedong.com/phpMan.php/man/arp/8/markdown),  [**hdparm**(8)](https://www.chedong.com/phpMan.php/man/hdparm/8/markdown),  [**ifconfig**(8)](https://www.chedong.com/phpMan.php/man/ifconfig/8/markdown),   [**lsmod**(8)](https://www.chedong.com/phpMan.php/man/lsmod/8/markdown),   [**lspci**(8)](https://www.chedong.com/phpMan.php/man/lspci/8/markdown),   [**mount**(8)](https://www.chedong.com/phpMan.php/man/mount/8/markdown),   [**netstat**(8)](https://www.chedong.com/phpMan.php/man/netstat/8/markdown),
       [**procinfo**(8)](https://www.chedong.com/phpMan.php/man/procinfo/8/markdown), [**route**(8)](https://www.chedong.com/phpMan.php/man/route/8/markdown), [**sysctl**(8)](https://www.chedong.com/phpMan.php/man/sysctl/8/markdown)

       The   Linux   kernel   source  files:  _Documentation/filesystems/proc.rst_,  _Documentation/ad‐_
       _min-guide/sysctl/fs.rst_,    _Documentation/admin-guide/sysctl/kernel.rst_,    _Documentation/ad‐_
       _min-guide/sysctl/net.rst_, and _Documentation/admin-guide/sysctl/vm.rst_.

Linux man-pages 6.7                          2023-10-31                                      [_proc_(5)](https://www.chedong.com/phpMan.php/man/proc/5/markdown)
