Debian Codegraph @

upstream/debian-unstable/man5/proc.5

raw
1 .\" Copyright 1994-1995, Daniel Quinlan <[email protected]>
2 .\" Copyright 2002-2017, Michael Kerrisk <[email protected]>
3 .\" Copyright, the authors of the Linux man-pages project
4 .\"
5 .\" SPDX-License-Identifier: GPL-3.0-or-later
6 .\"
7 .TH proc 5 2026-02-08 "Linux man-pages 6.18"
8 .SH NAME
9 proc \- process information, system information, and sysctl pseudo-filesystem
10 .SH DESCRIPTION
11 The
12 .B proc
13 filesystem is a pseudo-filesystem which provides an interface to
14 kernel data structures.
15 It is commonly mounted at
16 .IR /proc .
17 Typically, it is mounted automatically by the system,
18 but it can also be mounted manually using a command such as:
19 .P
20 .in +4n
21 .EX
22 mount \-t proc proc /proc
23 .EE
24 .in
25 .P
26 Most of the files in the
27 .B proc
28 filesystem are read-only,
29 but some files are writable, allowing kernel variables to be changed.
30 .\"
31 .SS Mount options
32 The
33 .B proc
34 filesystem supports the following mount options:
35 .TP
36 .BR hidepid= "\f[I]n\f[] (since Linux 3.3)"
37 .\" commit 0499680a42141d86417a8fbaa8c8db806bea1201
38 This option controls who can access the information in
39 .IR /proc/ pid
40 directories.
41 The argument,
42 .IR n ,
43 is one of the following values:
44 .RS
45 .TP 4
46 0
47 Everybody may access all
48 .IR /proc/ pid
49 directories.
50 This is the traditional behavior,
51 and the default if this mount option is not specified.
52 .TP
53 1
54 Users may not access files and subdirectories inside any
55 .IR /proc/ pid
56 directories but their own (the
57 .IR /proc/ pid
58 directories themselves remain visible).
59 Sensitive files such as
60 .IR /proc/ pid /cmdline
61 and
62 .IR /proc/ pid /status
63 are now protected against other users.
64 This makes it impossible to learn whether any user is running a
65 specific program
66 (so long as the program doesn't otherwise reveal itself by its behavior).
67 .\" As an additional bonus, since
68 .\" .IR /proc/[pid]/cmdline
69 .\" is inaccessible for other users,
70 .\" poorly written programs passing sensitive information via
71 .\" program arguments are now protected against local eavesdroppers.
72 .TP
73 2
74 As for mode 1, but in addition the
75 .IR /proc/ pid
76 directories belonging to other users become invisible.
77 This means that
78 .IR /proc/ pid
79 entries can no longer be used to discover the PIDs on the system.
80 This doesn't hide the fact that a process with a specific PID value exists
81 (it can be learned by other means, for example, by "kill \-0 $PID"),
82 but it hides a process's UID and GID,
83 which could otherwise be learned by employing
84 .BR stat (2)
85 on a
86 .IR /proc/ pid
87 directory.
88 This greatly complicates an attacker's task of gathering
89 information about running processes (e.g., discovering whether
90 some daemon is running with elevated privileges,
91 whether another user is running some sensitive program,
92 whether other users are running any program at all, and so on).
93 .TP
94 .BR gid= "\f[I]gid\f[] (since Linux 3.3)"
95 .\" commit 0499680a42141d86417a8fbaa8c8db806bea1201
96 Specifies the ID of a group whose members are authorized to
97 learn process information otherwise prohibited by
98 .B hidepid
99 (i.e., users in this group behave as though
100 .I /proc
101 was mounted with
102 .IR hidepid=0 ).
103 This group should be used instead of approaches such as putting
104 nonroot users into the
105 .BR sudoers (5)
106 file.
107 .RE
108 .TP
109 .BR subset=pid " (since Linux 5.8)"
110 .\" commit 6814ef2d992af09451bbeda4770daa204461329e
111 Show only the specified subset of procfs,
112 hiding all top level files and directories in the procfs
113 that are not related to tasks.
114 .SS Overview
115 Underneath
116 .IR /proc ,
117 there are the following general groups of files and subdirectories:
118 .TP
119 .IR /proc/ "pid subdirectories"
120 See
121 .BR proc_pid (5).
122 .IP
123 Each one of these subdirectories contains files and subdirectories
124 exposing information about the process with the corresponding process ID.
125 .IP
126 Underneath each of the
127 .IR /proc/ pid
128 directories, a
129 .I task
130 subdirectory contains subdirectories of the form
131 .IR task/ tid,
132 which contain corresponding information about each of the threads
133 in the process, where
134 .I tid
135 is the kernel thread ID of the thread.
136 .IP
137 The
138 .IR /proc/ pid
139 subdirectories are visible when iterating through
140 .I /proc
141 with
142 .BR getdents (2)
143 (and thus are visible when one uses
144 .BR ls (1)
145 to view the contents of
146 .IR /proc ).
147 .TP
148 .IR /proc/ "tid subdirectories"
149 See
150 .BR proc_tid (5).
151 .IP
152 Each one of these subdirectories contains files and subdirectories
153 exposing information about the thread with the corresponding thread ID.
154 The contents of these directories are the same as the corresponding
155 .IR /proc/ pid /task/ tid
156 directories.
157 .IP
158 The
159 .IR /proc/ tid
160 subdirectories are
161 .I not
162 visible when iterating through
163 .I /proc
164 with
165 .BR getdents (2)
166 (and thus are
167 .I not
168 visible when one uses
169 .BR ls (1)
170 to view the contents of
171 .IR /proc ).
172 .TP
173 .I /proc/self
174 See
175 .BR proc_self (5).
176 .IP
177 When a process accesses this magic symbolic link,
178 it resolves to the process's own
179 .IR /proc/ pid
180 directory.
181 .TP
182 .I /proc/thread\-self
183 See
184 .BR proc_thread-self (5).
185 .IP
186 When a thread accesses this magic symbolic link,
187 it resolves to the process's own
188 .IR /proc/self/task/ tid
189 directory.
190 .TP
191 .I /proc/[a\-z]*
192 .IP
193 Various other files and subdirectories under
194 .I /proc
195 expose system-wide information.
196 .IP
197 See also:
198 .RS
199 .TP
200 .BR proc_apm (5)
201 .TQ
202 .BR proc_buddyinfo (5)
203 .TQ
204 .BR proc_bus (5)
205 .TQ
206 .BR proc_cgroups (5)
207 .TQ
208 .BR proc_cmdline (5)
209 .TQ
210 .BR proc_config.gz (5)
211 .TQ
212 .BR proc_cpuinfo (5)
213 .TQ
214 .BR proc_crypto (5)
215 .TQ
216 .BR proc_devices (5)
217 .TQ
218 .BR proc_diskstats (5)
219 .TQ
220 .BR proc_dma (5)
221 .TQ
222 .BR proc_driver (5)
223 .TQ
224 .BR proc_execdomains (5)
225 .TQ
226 .BR proc_fb (5)
227 .TQ
228 .BR proc_filesystems (5)
229 .TQ
230 .BR proc_fs (5)
231 .TQ
232 .BR proc_ide (5)
233 .TQ
234 .BR proc_interrupts (5)
235 .TQ
236 .BR proc_iomem (5)
237 .TQ
238 .BR proc_ioports (5)
239 .TQ
240 .BR proc_kallsyms (5)
241 .TQ
242 .BR proc_kcore (5)
243 .TQ
244 .BR proc_key-users (5)
245 .TQ
246 .BR proc_keys (5)
247 .TQ
248 .BR proc_kmsg (5)
249 .TQ
250 .BR proc_kpagecgroup (5)
251 .TQ
252 .BR proc_kpagecount (5)
253 .TQ
254 .BR proc_kpageflags (5)
255 .TQ
256 .BR proc_ksyms (5)
257 .TQ
258 .BR proc_loadavg (5)
259 .TQ
260 .BR proc_locks (5)
261 .TQ
262 .BR proc_malloc (5)
263 .TQ
264 .BR proc_meminfo (5)
265 .TQ
266 .BR proc_modules (5)
267 .TQ
268 .BR proc_mounts (5)
269 .TQ
270 .BR proc_mtrr (5)
271 .TQ
272 .BR proc_net (5)
273 .TQ
274 .BR proc_partitions (5)
275 .TQ
276 .BR proc_pci (5)
277 .TQ
278 .BR proc_profile (5)
279 .TQ
280 .BR proc_scsi (5)
281 .TQ
282 .BR proc_slabinfo (5)
283 .TQ
284 .BR proc_stat (5)
285 .TQ
286 .BR proc_swaps (5)
287 .TQ
288 .BR proc_sys (5)
289 .TQ
290 .BR proc_sysrq-trigger (5)
291 .TQ
292 .BR proc_sysvipc (5)
293 .TQ
294 .BR proc_timer_list (5)
295 .TQ
296 .BR proc_timer_stats (5)
297 .TQ
298 .BR proc_tty (5)
299 .TQ
300 .BR proc_uptime (5)
301 .TQ
302 .BR proc_version (5)
303 .TQ
304 .BR proc_vmstat (5)
305 .TQ
306 .BR proc_zoneinfo (5)
307 .RE
308 .\"
309 .\" .SH FILES
310 .\" FIXME Describe /proc/[pid]/sessionid
311 .\" commit 1e0bd7550ea9cf474b1ad4c6ff5729a507f75fdc
312 .\" CONFIG_AUDITSYSCALL
313 .\" Added in Linux 2.6.25; read-only; only readable by real UID
314 .\"
315 .\" FIXME Describe /proc/[pid]/sched
316 .\" Added in Linux 2.6.23
317 .\" CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS
318 .\" Displays various scheduling parameters
319 .\" This file can be written, to reset stats
320 .\" The set of fields exposed by this file have changed
321 .\" significantly over time.
322 .\" commit 43ae34cb4cd650d1eb4460a8253a8e747ba052ac
323 .\"
324 .\" FIXME Describe /proc/[pid]/schedstats and
325 .\" /proc/[pid]/task/[tid]/schedstats
326 .\" Added in Linux 2.6.9
327 .\" CONFIG_SCHEDSTATS
328 .\" FIXME Document /proc/sched_debug (since Linux 2.6.23)
329 .\" See also /proc/[pid]/sched
330 .\" FIXME 2.6.13 seems to have /proc/vmcore implemented; document this
331 .\" See Documentation/kdump/kdump.rst
332 .\" commit 666bfddbe8b8fd4fd44617d6c55193d5ac7edb29
333 .\" Needs CONFIG_VMCORE
334 .\"
335 .SH NOTES
336 Many files contain strings (e.g., the environment and command line)
337 that are in the internal format,
338 with subfields terminated by null bytes (\[aq]\[rs]0\[aq]).
339 When inspecting such files, you may find that the results are more readable
340 if you use a command of the following form to display them:
341 .P
342 .in +4n
343 .EX
344 .RB $ " cat \f[I]file\f[] | tr \[aq]\[rs]000\[aq] \[aq]\[rs]n\[aq]"
345 .EE
346 .in
347 .\" .SH ACKNOWLEDGEMENTS
348 .\" The material on /proc/sys/fs and /proc/sys/kernel is closely based on
349 .\" kernel source documentation files written by Rik van Riel.
350 .SH SEE ALSO
351 .BR cat (1),
352 .BR dmesg (1),
353 .BR find (1),
354 .BR free (1),
355 .BR htop (1),
356 .BR init (1),
357 .BR ps (1),
358 .BR pstree (1),
359 .BR tr (1),
360 .BR uptime (1),
361 .BR chroot (2),
362 .BR mmap (2),
363 .BR readlink (2),
364 .BR syslog (2),
365 .BR slabinfo (5),
366 .BR sysfs (5),
367 .BR hier (7),
368 .BR namespaces (7),
369 .BR time (7),
370 .BR arp (8),
371 .BR hdparm (8),
372 .BR ifconfig (8),
373 .BR lsmod (8),
374 .BR lspci (8),
375 .BR mount (8),
376 .BR netstat (8),
377 .BR procinfo (8),
378 .BR route (8),
379 .BR sysctl (8)
380 .P
381 The Linux kernel source files:
382 .IR Documentation/filesystems/proc.rst ,
383 .IR Documentation/admin\-guide/sysctl/fs.rst ,
384 .IR Documentation/admin\-guide/sysctl/kernel.rst ,
385 .IR Documentation/admin\-guide/sysctl/net.rst ,
386 and
387 .IR Documentation/admin\-guide/sysctl/vm.rst .