{
    "content": [
        {
            "type": "text",
            "text": "# proc (man)\n\n## NAME\n\nproc - process information, system information, and sysctl pseudo-filesystem\n\n## DESCRIPTION\n\nThe  proc filesystem is a pseudo-filesystem which provides an interface to kernel data struc‐\ntures.  It is commonly mounted at /proc.  Typically, it is mounted automatically by the  sys‐\ntem, but it can also be mounted manually using a command such as:\n\n## TLDR\n\n> /proc is a pseudo-filesystem containing running process information and more\n\n- See the command line arguments that started the process:\n  `cat {{path}}&lt;pid&gt;/cmdline`\n- See the process's environment variables:\n  `cat {{path}}&lt;pid&gt;/environ`\n- See the process's status and usage information, such as CPU and memory:\n  `cat {{path}}&lt;pid&gt;/status`\n- See every file the process has open:\n  `ls -l {{path}}&lt;pid&gt;/fd`\n- Display some useful memory statistics, often used by programs like htop(1):\n  `cat {{path}}`\n\n*Source: cheat.sh*\n\n## Sections\n\n- **NAME**\n- **DESCRIPTION** (2 subsections)\n- **NOTES**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "proc",
        "section": "",
        "mode": "man",
        "summary": "proc - process information, system information, and sysctl pseudo-filesystem",
        "synopsis": null,
        "tldr_summary": "/proc is a pseudo-filesystem containing running process information and more",
        "tldr_examples": [
            {
                "description": "See the command line arguments that started the process",
                "command": "cat {{path}}&lt;pid&gt;/cmdline"
            },
            {
                "description": "See the process's environment variables",
                "command": "cat {{path}}&lt;pid&gt;/environ"
            },
            {
                "description": "See the process's status and usage information, such as CPU and memory",
                "command": "cat {{path}}&lt;pid&gt;/status"
            },
            {
                "description": "See every file the process has open",
                "command": "ls -l {{path}}&lt;pid&gt;/fd"
            },
            {
                "description": "Display some useful memory statistics, often used by programs like htop(1)",
                "command": "cat {{path}}"
            }
        ],
        "tldr_source": "cheatsh",
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "cat",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/cat/1/json"
            },
            {
                "name": "dmesg",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/dmesg/1/json"
            },
            {
                "name": "find",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/find/1/json"
            },
            {
                "name": "free",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/free/1/json"
            },
            {
                "name": "htop",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/htop/1/json"
            },
            {
                "name": "init",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/init/1/json"
            },
            {
                "name": "ps",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ps/1/json"
            },
            {
                "name": "pstree",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pstree/1/json"
            },
            {
                "name": "tr",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/tr/1/json"
            },
            {
                "name": "uptime",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/uptime/1/json"
            },
            {
                "name": "root",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/root/2/json"
            },
            {
                "name": "mmap",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/mmap/2/json"
            },
            {
                "name": "readlink",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/readlink/2/json"
            },
            {
                "name": "syslog",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/syslog/2/json"
            },
            {
                "name": "slabinfo",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/slabinfo/5/json"
            },
            {
                "name": "sysfs",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/sysfs/5/json"
            },
            {
                "name": "hier",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/hier/7/json"
            },
            {
                "name": "namespaces",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/namespaces/7/json"
            },
            {
                "name": "time",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/time/7/json"
            },
            {
                "name": "arp",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/arp/8/json"
            },
            {
                "name": "hdparm",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/hdparm/8/json"
            },
            {
                "name": "ifconfig",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/ifconfig/8/json"
            },
            {
                "name": "lsmod",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/lsmod/8/json"
            },
            {
                "name": "lspci",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/lspci/8/json"
            },
            {
                "name": "mount",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mount/8/json"
            },
            {
                "name": "netstat",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/netstat/8/json"
            },
            {
                "name": "procinfo",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/procinfo/8/json"
            },
            {
                "name": "route",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/route/8/json"
            },
            {
                "name": "sysctl",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/sysctl/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 9,
                "subsections": [
                    {
                        "name": "Mount options",
                        "lines": 32
                    },
                    {
                        "name": "Overview",
                        "lines": 34
                    }
                ]
            },
            {
                "name": "NOTES",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 10,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "proc - process information, system information, and sysctl pseudo-filesystem\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The  proc filesystem is a pseudo-filesystem which provides an interface to kernel data struc‐\ntures.  It is commonly mounted at /proc.  Typically, it is mounted automatically by the  sys‐\ntem, but it can also be mounted manually using a command such as:\n\nmount -t proc proc /proc\n\nMost of the files in the proc filesystem are read-only, but some files are writable, allowing\nkernel variables to be changed.\n",
                "subsections": [
                    {
                        "name": "Mount options",
                        "content": "The proc filesystem supports the following mount options:\n\nhidepid=n (since Linux 3.3)\nThis option controls who can access the information in /proc/pid directories.  The ar‐\ngument, n, is one of the following values:\n\n0   Everybody may access all /proc/pid directories.  This is the traditional behavior,\nand the default if this mount option is not specified.\n\n1   Users may not access files and subdirectories inside any /proc/pid directories but\ntheir  own (the /proc/pid directories themselves remain visible).  Sensitive files\nsuch as /proc/pid/cmdline and /proc/pid/status are  now  protected  against  other\nusers.   This  makes it impossible to learn whether any user is running a specific\nprogram (so long as the program doesn't otherwise reveal itself by its behavior).\n\n2   As for mode 1, but in addition the /proc/pid directories belonging to other  users\nbecome invisible.  This means that /proc/pid entries can no longer be used to dis‐\ncover  the  PIDs  on the system.  This doesn't hide the fact that a process with a\nspecific PID value exists (it can be learned by other means, for example, by \"kill\n-0 $PID\"), but it hides a process's UID and GID, which could otherwise be  learned\nby  employing  stat(2)  on a /proc/pid directory.  This greatly complicates an at‐\ntacker's task of gathering information about running processes (e.g.,  discovering\nwhether  some  daemon is running with elevated privileges, whether another user is\nrunning some sensitive program, whether other users are  running  any  program  at\nall, and so on).\n\ngid=gid (since Linux 3.3)\nSpecifies  the ID of a group whose members are authorized to learn process information\notherwise prohibited by hidepid (i.e., users in this group behave as though /proc  was\nmounted  with  hidepid=0).   This  group  should be used instead of approaches such as\nputting nonroot users into the sudoers(5) file.\n"
                    },
                    {
                        "name": "Overview",
                        "content": "Underneath /proc, there are the following general groups of files and subdirectories:\n\n/proc/pid subdirectories\nEach one of these subdirectories contains files and subdirectories  exposing  informa‐\ntion about the process with the corresponding process ID.\n\nUnderneath each of the /proc/pid directories, a task subdirectory contains subdirecto‐\nries  of  the form task/tid, which contain corresponding information about each of the\nthreads in the process, where tid is the kernel thread ID of the thread.\n\nThe /proc/pid subdirectories are visible when iterating through /proc with getdents(2)\n(and thus are visible when one uses ls(1) to view the contents of /proc).\n\n/proc/tid subdirectories\nEach one of these subdirectories contains files and subdirectories  exposing  informa‐\ntion  about the thread with the corresponding thread ID.  The contents of these direc‐\ntories are the same as the corresponding /proc/pid/task/tid directories.\n\nThe /proc/tid subdirectories are not visible when iterating through  /proc  with  get‐\ndents(2) (and thus are not visible when one uses ls(1) to view the contents of /proc).\n\n/proc/self\nWhen  a  process  accesses  this magic symbolic link, it resolves to the process's own\n/proc/pid directory.\n\n/proc/thread-self\nWhen a thread accesses this magic symbolic link, it  resolves  to  the  process's  own\n/proc/self/task/tid directory.\n\n/proc/[a-z]*\nVarious other files and subdirectories under /proc expose system-wide information.\n\nAll of the above are described in more detail below.\n"
                    }
                ]
            },
            "NOTES": {
                "content": "Many  files contain strings (e.g., the environment and command line) that are in the internal\nformat, with subfields terminated by null bytes ('\\0').  When inspecting such files, you  may\nfind that the results are more readable if you use a command of the following form to display\nthem:\n\n$ cat file | tr '\\000' '\\n'\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "cat(1), dmesg(1), find(1), free(1), htop(1), init(1), ps(1), pstree(1), tr(1), uptime(1), ch‐\nroot(2),  mmap(2),  readlink(2),  syslog(2),  slabinfo(5),  sysfs(5), hier(7), namespaces(7),\ntime(7),  arp(8),  hdparm(8),  ifconfig(8),   lsmod(8),   lspci(8),   mount(8),   netstat(8),\nprocinfo(8), route(8), sysctl(8)\n\nThe   Linux   kernel   source  files:  Documentation/filesystems/proc.rst,  Documentation/ad‐\nmin-guide/sysctl/fs.rst,    Documentation/admin-guide/sysctl/kernel.rst,    Documentation/ad‐\nmin-guide/sysctl/net.rst, and Documentation/admin-guide/sysctl/vm.rst.\n\nLinux man-pages 6.7                          2023-10-31                                      proc(5)",
                "subsections": []
            }
        }
    }
}