1PROC(5) Linux Programmer's Manual PROC(5)
2
3
4
6 proc - process information pseudo-file system
7
9 The proc file system is a pseudo-file system which is used as an inter‐
10 face to kernel data structures. It is commonly mounted at /proc. Most
11 of it is read-only, but some files allow kernel variables to be
12 changed.
13
14 The following outline gives a quick tour through the /proc hierarchy.
15
16 /proc/[pid]
17 There is a numerical subdirectory for each running process; the
18 subdirectory is named by the process ID. Each such subdirectory
19 contains the following pseudo-files and directories.
20
21 /proc/[pid]/auxv (since 2.6.0-test7)
22 This contains the contents of the ELF interpreter information
23 passed to the process at exec time. The format is one unsigned
24 long ID plus one unsigned long value for each entry. The last
25 entry contains two zeros.
26
27 /proc/[pid]/cmdline
28 This holds the complete command line for the process, unless the
29 process is a zombie. In the latter case, there is nothing in
30 this file: that is, a read on this file will return 0 charac‐
31 ters. The command-line arguments appear in this file as a set
32 of null-separated strings, with a further null byte ('\0') after
33 the last string.
34
35 /proc/[pid]/coredump_filter (since kernel 2.6.23)
36 See core(5).
37
38 /proc/[pid]/cpuset (since kernel 2.6.12)
39 See cpuset(7).
40
41 /proc/[pid]/cwd
42 This is a symbolic link to the current working directory of the
43 process. To find out the current working directory of process
44 20, for instance, you can do this:
45
46 $ cd /proc/20/cwd; /bin/pwd
47
48 Note that the pwd command is often a shell built-in, and might
49 not work properly. In bash(1), you may use pwd -P.
50
51 In a multithreaded process, the contents of this symbolic link
52 are not available if the main thread has already terminated
53 (typically by calling pthread_exit(3)).
54
55 /proc/[pid]/environ
56 This file contains the environment for the process. The entries
57 are separated by null bytes ('\0'), and there may be a null byte
58 at the end. Thus, to print out the environment of process 1,
59 you would do:
60
61 $ (cat /proc/1/environ; echo) | tr '\000' '\n'
62
63 /proc/[pid]/exe
64 Under Linux 2.2 and later, this file is a symbolic link contain‐
65 ing the actual pathname of the executed command. This symbolic
66 link can be dereferenced normally; attempting to open it will
67 open the executable. You can even type /proc/[pid]/exe to run
68 another copy of the same executable as is being run by process
69 [pid]. In a multithreaded process, the contents of this sym‐
70 bolic link are not available if the main thread has already ter‐
71 minated (typically by calling pthread_exit(3)).
72
73 Under Linux 2.0 and earlier /proc/[pid]/exe is a pointer to the
74 binary which was executed, and appears as a symbolic link. A
75 readlink(2) call on this file under Linux 2.0 returns a string
76 in the format:
77
78 [device]:inode
79
80 For example, [0301]:1502 would be inode 1502 on device major 03
81 (IDE, MFM, etc. drives) minor 01 (first partition on the first
82 drive).
83
84 find(1) with the -inum option can be used to locate the file.
85
86 /proc/[pid]/fd
87 This is a subdirectory containing one entry for each file which
88 the process has open, named by its file descriptor, and which is
89 a symbolic link to the actual file. Thus, 0 is standard input,
90 1 standard output, 2 standard error, etc.
91
92 In a multithreaded process, the contents of this directory are
93 not available if the main thread has already terminated (typi‐
94 cally by calling pthread_exit(3)).
95
96 Programs that will take a filename as a command-line argument,
97 but will not take input from standard input if no argument is
98 supplied, or that write to a file named as a command-line argu‐
99 ment, but will not send their output to standard output if no
100 argument is supplied, can nevertheless be made to use standard
101 input or standard out using /proc/[pid]/fd. For example, assum‐
102 ing that -i is the flag designating an input file and -o is the
103 flag designating an output file:
104
105 $ foobar -i /proc/self/fd/0 -o /proc/self/fd/1 ...
106
107 and you have a working filter.
108
109 /proc/self/fd/N is approximately the same as /dev/fd/N in some
110 Unix and Unix-like systems. Most Linux MAKEDEV scripts symboli‐
111 cally link /dev/fd to /proc/self/fd, in fact.
112
113 Most systems provide symbolic links /dev/stdin, /dev/stdout, and
114 /dev/stderr, which respectively link to the files 0, 1, and 2 in
115 /proc/self/fd. Thus the example command above could be written
116 as:
117
118 $ foobar -i /dev/stdin -o /dev/stdout ...
119
120 /proc/[pid]/fdinfo/ (since kernel 2.6.22)
121 This is a subdirectory containing one entry for each file which
122 the process has open, named by its file descriptor. The con‐
123 tents of each file can be read to obtain information about the
124 corresponding file descriptor, for example:
125
126 $ cat /proc/12015/fdinfo/4
127 pos: 1000
128 flags: 01002002
129
130 The pos field is a decimal number showing the current file off‐
131 set. The flags field is an octal number that displays the file
132 access mode and file status flags (see open(2)).
133
134 The files in this directory are readable only by the owner of
135 the process.
136
137 /proc/[pid]/limits (since kernel 2.6.24)
138 This file displays the soft limit, hard limit, and units of mea‐
139 surement for each of the process's resource limits (see getr‐
140 limit(2)). The file is protected to only allow reading by the
141 real UID of the process.
142
143 /proc/[pid]/maps
144 A file containing the currently mapped memory regions and their
145 access permissions.
146
147 The format is:
148
149 address perms offset dev inode pathname
150 08048000-08056000 r-xp 00000000 03:0c 64593 /usr/sbin/gpm
151 08056000-08058000 rw-p 0000d000 03:0c 64593 /usr/sbin/gpm
152 08058000-0805b000 rwxp 00000000 00:00 0
153 40000000-40013000 r-xp 00000000 03:0c 4165 /lib/ld-2.2.4.so
154 40013000-40015000 rw-p 00012000 03:0c 4165 /lib/ld-2.2.4.so
155 4001f000-40135000 r-xp 00000000 03:0c 45494 /lib/libc-2.2.4.so
156 40135000-4013e000 rw-p 00115000 03:0c 45494 /lib/libc-2.2.4.so
157 4013e000-40142000 rw-p 00000000 00:00 0
158 bffff000-c0000000 rwxp 00000000 00:00 0
159
160 where "address" is the address space in the process that it
161 occupies, "perms" is a set of permissions:
162
163 r = read
164 w = write
165 x = execute
166 s = shared
167 p = private (copy on write)
168
169 "offset" is the offset into the file/whatever, "dev" is the
170 device (major:minor), and "inode" is the inode on that device.
171 0 indicates that no inode is associated with the memory region,
172 as the case would be with BSS (uninitialized data).
173
174 Under Linux 2.0 there is no field giving pathname.
175
176 /proc/[pid]/mem
177 This file can be used to access the pages of a process's memory
178 through open(2), read(2), and lseek(2).
179
180 /proc/[pid]/mountinfo (since Linux 2.6.26)
181 This file contains information about mount points. It contains
182 lines of the form:
183
184 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue
185 (1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11)
186
187 The numbers in parentheses are labels for the descriptions
188 below:
189
190 (1) mount ID: unique identifier of the mount (may be reused
191 after umount(2)).
192
193 (2) parent ID: ID of parent mount (or of self for the top of
194 the mount tree).
195
196 (3) major:minor: value of st_dev for files on file system (see
197 stat(2)).
198
199 (4) root: root of the mount within the file system.
200
201 (5) mount point: mount point relative to the process's root.
202
203 (6) mount options: per-mount options.
204
205 (7) optional fields: zero or more fields of the form
206 "tag[:value]".
207
208 (8) separator: marks the end of the optional fields.
209
210 (9) file system type: name of file system in the form
211 "type[.subtype]".
212
213 (10) mount source: file system-specific information or "none".
214
215 (11) super options: per-super block options.
216
217 Parsers should ignore all unrecognized optional fields. Cur‐
218 rently the possible optional fields are:
219
220 shared:X mount is shared in peer group X
221
222 master:X mount is slave to peer group X
223
224 propagate_from:X mount is slave and receives propagation
225 from peer group X (*)
226
227 unbindable mount is unbindable
228
229 (*) X is the closest dominant peer group under the process's
230 root. If X is the immediate master of the mount, or if there is
231 no dominant peer group under the same root, then only the "mas‐
232 ter:X" field is present and not the "propagate_from:X" field.
233
234 For more information on mount propagation see: Documenta‐
235 tion/filesystems/sharedsubtree.txt in the kernel source tree.
236
237 /proc/[pid]/mounts (since Linux 2.4.19)
238 This is a list of all the file systems currently mounted in the
239 process's mount namespace. The format of this file is docu‐
240 mented in fstab(5). Since kernel version 2.6.15, this file is
241 pollable: after opening the file for reading, a change in this
242 file (i.e., a file system mount or unmount) causes select(2) to
243 mark the file descriptor as readable, and poll(2) and
244 epoll_wait(2) mark the file as having an error condition.
245
246 /proc/[pid]/mountstats (since Linux 2.6.17)
247 This file exports information (statistics, configuration infor‐
248 mation) about the mount points in the process's name space.
249 Lines in this file have the form:
250
251 device /dev/sda7 mounted on /home with fstype ext3 [statistics]
252 ( 1 ) ( 2 ) (3 ) (4)
253
254 The fields in each line are:
255
256 (1) The name of the mounted device (or "nodevice" if there is
257 no corresponding device).
258
259 (2) The mount point within the file system tree.
260
261 (3) The file system type.
262
263 (4) Optional statistics and configuration information. Cur‐
264 rently (as at Linux 2.6.26), only NFS file systems export
265 information via this field.
266
267 This file is only readable by the owner of the process.
268
269 /proc/[pid]/numa_maps (since Linux 2.6.14)
270 See numa(7).
271
272 /proc/[pid]/oom_adj (since Linux 2.6.11)
273 This file can be used to adjust the score used to select which
274 process should be killed in an out-of-memory (OOM) situation.
275 The kernel uses this value for a bit-shift operation of the
276 process's oom_score value: valid values are in the range -16 to
277 +15, plus the special value -17, which disables OOM-killing
278 altogether for this process. A positive score increases the
279 likelihood of this process being killed by the OOM-killer; a
280 negative score decreases the likelihood. The default value for
281 this file is 0; a new process inherits its parent's oom_adj set‐
282 ting. A process must be privileged (CAP_SYS_RESOURCE) to update
283 this file.
284
285 /proc/[pid]/oom_score (since Linux 2.6.11)
286 This file displays the current score that the kernel gives to
287 this process for the purpose of selecting a process for the OOM-
288 killer. A higher score means that the process is more likely to
289 be selected by the OOM-killer. The basis for this score is the
290 amount of memory used by the process, with increases (+) or
291 decreases (-) for factors including:
292
293 * whether the process creates a lot of children using fork(2)
294 (+);
295
296 * whether the process has been running a long time, or has used
297 a lot of CPU time (-);
298
299 * whether the process has a low nice value (i.e., > 0) (+);
300
301 * whether the process is privileged (-); and
302
303 * whether the process is making direct hardware access (-).
304
305 The oom_score also reflects the bit-shift adjustment specified
306 by the oom_adj setting for the process.
307
308 /proc/[pid]/root
309 Unix and Linux support the idea of a per-process root of the
310 file system, set by the chroot(2) system call. This file is a
311 symbolic link that points to the process's root directory, and
312 behaves as exe, fd/*, etc. do.
313
314 In a multithreaded process, the contents of this symbolic link
315 are not available if the main thread has already terminated
316 (typically by calling pthread_exit(3)).
317
318 /proc/[pid]/smaps (since Linux 2.6.14)
319 This file shows memory consumption for each of the process's
320 mappings. For each of mappings there is a series of lines such
321 as the following:
322
323 08048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash
324 Size: 464 kB
325 Rss: 424 kB
326 Shared_Clean: 424 kB
327 Shared_Dirty: 0 kB
328 Private_Clean: 0 kB
329 Private_Dirty: 0 kB
330
331 The first of these lines shows the same information as is dis‐
332 played for the mapping in /proc/[pid]/maps. The remaining lines
333 show the size of the mapping, the amount of the mapping that is
334 currently resident in RAM, the number of clean and dirty shared
335 pages in the mapping, and the number of clean and dirty private
336 pages in the mapping.
337
338 This file is only present if the CONFIG_MMU kernel configuration
339 option is enabled.
340
341 /proc/[pid]/stat
342 Status information about the process. This is used by ps(1).
343 It is defined in /usr/src/linux/fs/proc/array.c.
344
345 The fields, in order, with their proper scanf(3) format speci‐
346 fiers, are:
347
348 pid %d The process ID.
349
350 comm %s The filename of the executable, in parentheses.
351 This is visible whether or not the executable is
352 swapped out.
353
354 state %c One character from the string "RSDZTW" where R is
355 running, S is sleeping in an interruptible wait, D
356 is waiting in uninterruptible disk sleep, Z is zom‐
357 bie, T is traced or stopped (on a signal), and W is
358 paging.
359
360 ppid %d The PID of the parent.
361
362 pgrp %d The process group ID of the process.
363
364 session %d The session ID of the process.
365
366 tty_nr %d The controlling terminal of the process. (The minor
367 device number is contained in the combination of
368 bits 31 to 20 and 7 to 0; the major device number is
369 in bits 15 t0 8.)
370
371 tpgid %d The ID of the foreground process group of the con‐
372 trolling terminal of the process.
373
374 flags %u (%lu before Linux 2.6.22)
375 The kernel flags word of the process. For bit mean‐
376 ings, see the PF_* defines in <linux/sched.h>.
377 Details depend on the kernel version.
378
379 minflt %lu The number of minor faults the process has made
380 which have not required loading a memory page from
381 disk.
382
383 cminflt %lu The number of minor faults that the process's
384 waited-for children have made.
385
386 majflt %lu The number of major faults the process has made
387 which have required loading a memory page from disk.
388
389 cmajflt %lu The number of major faults that the process's
390 waited-for children have made.
391
392 utime %lu Amount of time that this process has been scheduled
393 in user mode, measured in clock ticks (divide by
394 sysconf(_SC_CLK_TCK). This includes guest time,
395 guest_time (time spent running a virtual CPU, see
396 below), so that applications that are not aware of
397 the guest time field do not lose that time from
398 their calculations.
399
400 stime %lu Amount of time that this process has been scheduled
401 in kernel mode, measured in clock ticks (divide by
402 sysconf(_SC_CLK_TCK).
403
404 cutime %ld Amount of time that this process's waited-for chil‐
405 dren have been scheduled in user mode, measured in
406 clock ticks (divide by sysconf(_SC_CLK_TCK). (See
407 also times(2).) This includes guest time,
408 cguest_time (time spent running a virtual CPU, see
409 below).
410
411 cstime %ld Amount of time that this process's waited-for chil‐
412 dren have been scheduled in kernel mode, measured in
413 clock ticks (divide by sysconf(_SC_CLK_TCK).
414
415 priority %ld
416 (Explanation for Linux 2.6) For processes running a
417 real-time scheduling policy (policy below; see
418 sched_setscheduler(2)), this is the negated schedul‐
419 ing priority, minus one; that is, a number in the
420 range -2 to -100, corresponding to real-time priori‐
421 ties 1 to 99. For processes running under a non-
422 real-time scheduling policy, this is the raw nice
423 value (setpriority(2)) as represented in the kernel.
424 The kernel stores nice values as numbers in the
425 range 0 (high) to 39 (low), corresponding to the
426 user-visible nice range of -20 to 19.
427
428 Before Linux 2.6, this was a scaled value based on
429 the scheduler weighting given to this process.
430
431 nice %ld The nice value (see setpriority(2)), a value in the
432 range 19 (low priority) to -20 (high priority).
433
434 num_threads %ld
435 Number of threads in this process (since Linux 2.6).
436 Before kernel 2.6, this field was hard coded to 0 as
437 a placeholder for an earlier removed field.
438
439 itrealvalue %ld
440 The time in jiffies before the next SIGALRM is sent
441 to the process due to an interval timer. Since ker‐
442 nel 2.6.17, this field is no longer maintained, and
443 is hard coded as 0.
444
445 starttime %llu (was %lu before Linux 2.6)
446 The time in jiffies the process started after system
447 boot.
448
449 vsize %lu Virtual memory size in bytes.
450
451 rss %ld Resident Set Size: number of pages the process has
452 in real memory. This is just the pages which count
453 towards text, data, or stack space. This does not
454 include pages which have not been demand-loaded in,
455 or which are swapped out.
456
457 rsslim %lu Current soft limit in bytes on the rss of the
458 process; see the description of RLIMIT_RSS in get‐
459 priority(2).
460
461 startcode %lu
462 The address above which program text can run.
463
464 endcode %lu The address below which program text can run.
465
466 startstack %lu
467 The address of the start (i.e., bottom) of the
468 stack.
469
470 kstkesp %lu The current value of ESP (stack pointer), as found
471 in the kernel stack page for the process.
472
473 kstkeip %lu The current EIP (instruction pointer).
474
475 signal %lu The bitmap of pending signals, displayed as a deci‐
476 mal number. Obsolete, because it does not provide
477 information on real-time signals; use
478 /proc/[pid]/status instead.
479
480 blocked %lu The bitmap of blocked signals, displayed as a deci‐
481 mal number. Obsolete, because it does not provide
482 information on real-time signals; use
483 /proc/[pid]/status instead.
484
485 sigignore %lu
486 The bitmap of ignored signals, displayed as a deci‐
487 mal number. Obsolete, because it does not provide
488 information on real-time signals; use
489 /proc/[pid]/status instead.
490
491 sigcatch %lu
492 The bitmap of caught signals, displayed as a decimal
493 number. Obsolete, because it does not provide
494 information on real-time signals; use
495 /proc/[pid]/status instead.
496
497 wchan %lu This is the "channel" in which the process is wait‐
498 ing. It is the address of a system call, and can be
499 looked up in a namelist if you need a textual name.
500 (If you have an up-to-date /etc/psdatabase, then try
501 ps -l to see the WCHAN field in action.)
502
503 nswap %lu Number of pages swapped (not maintained).
504
505 cnswap %lu Cumulative nswap for child processes (not main‐
506 tained).
507
508 exit_signal %d (since Linux 2.1.22)
509 Signal to be sent to parent when we die.
510
511 processor %d (since Linux 2.2.8)
512 CPU number last executed on.
513
514 rt_priority %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
515 Real-time scheduling priority, a number in the range
516 1 to 99 for processes scheduled under a real-time
517 policy, or 0, for non-real-time processes (see
518 sched_setscheduler(2)).
519
520 policy %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
521 Scheduling policy (see sched_setscheduler(2)).
522 Decode using the SCHED_* constants in linux/sched.h.
523
524 delayacct_blkio_ticks %llu (since Linux 2.6.18)
525 Aggregated block I/O delays, measured in clock ticks
526 (centiseconds).
527
528 guest_time %lu (since Linux 2.6.24)
529 Guest time of the process (time spent running a vir‐
530 tual CPU for a guest operating system), measured in
531 clock ticks (divide by sysconf(_SC_CLK_TCK).
532
533 cguest_time %ld (since Linux 2.6.24)
534 Guest time of the process's children, measured in
535 clock ticks (divide by sysconf(_SC_CLK_TCK).
536
537 /proc/[pid]/statm
538 Provides information about memory usage, measured in pages. The
539 columns are:
540
541 size total program size
542 (same as VmSize in /proc/[pid]/status)
543 resident resident set size
544 (same as VmRSS in /proc/[pid]/status)
545 share shared pages (from shared mappings)
546 text text (code)
547 lib library (unused in Linux 2.6)
548 data data + stack
549 dt dirty pages (unused in Linux 2.6)
550
551 /proc/[pid]/status
552 Provides much of the information in /proc/[pid]/stat and
553 /proc/[pid]/statm in a format that's easier for humans to parse.
554 Here's an example:
555
556 $ cat /proc/$$/status
557 Name: bash
558 State: S (sleeping)
559 Tgid: 3515
560 Pid: 3515
561 PPid: 3452
562 TracerPid: 0
563 Uid: 1000 1000 1000 1000
564 Gid: 100 100 100 100
565 FDSize: 256
566 Groups: 16 33 100
567 VmPeak: 9136 kB
568 VmSize: 7896 kB
569 VmLck: 0 kB
570 VmHWM: 7572 kB
571 VmRSS: 6316 kB
572 VmData: 5224 kB
573 VmStk: 88 kB
574 VmExe: 572 kB
575 VmLib: 1708 kB
576 VmPTE: 20 kB
577 Threads: 1
578 SigQ: 0/3067
579 SigPnd: 0000000000000000
580 ShdPnd: 0000000000000000
581 SigBlk: 0000000000010000
582 SigIgn: 0000000000384004
583 SigCgt: 000000004b813efb
584 CapInh: 0000000000000000
585 CapPrm: 0000000000000000
586 CapEff: 0000000000000000
587 CapBnd: ffffffffffffffff
588 Cpus_allowed: 00000001
589 Cpus_allowed_list: 0
590 Mems_allowed: 1
591 Mems_allowed_list: 0
592 voluntary_ctxt_switches: 150
593 nonvoluntary_ctxt_switches: 545
594
595 The fields are as follows:
596
597 * Name: Command run by this process.
598
599 * State: Current state of the process. One of "R (running)", "S
600 (sleeping)", "D (disk sleep)", "T (stopped)", "T (tracing
601 stop)", "Z (zombie)", or "X (dead)".
602
603 * Tgid: Thread group ID (i.e., Process ID).
604
605 * Pid: Thread ID (see gettid(2)).
606
607 * TracerPid: PID of process tracing this process (0 if not being
608 traced).
609
610 * Uid, Gid: Real, effective, saved set, and file system UIDs
611 (GIDs).
612
613 * FDSize: Number of file descriptor slots currently allocated.
614
615 * Groups: Supplementary group list.
616
617 * VmPeak: Peak virtual memory size.
618
619 * VmSize: Virtual memory size.
620
621 * VmLck: Locked memory size.
622
623 * VmHWM: Peak resident set size ("high water mark").
624
625 * VmRSS: Resident set size.
626
627 * VmData, VmStk, VmExe: Size of data, stack, and text segments.
628
629 * VmLib: Shared library code size.
630
631 * VmPTE: Page table entries size (since Linux 2.6.10).
632
633 * Threads: Number of threads in process containing this thread.
634
635 * SigPnd, ShdPnd: Number of signals pending for thread and for
636 process as a whole (see pthreads(7) and signal(7)).
637
638 * SigBlk, SigIgn, SigCgt: Masks indicating signals being
639 blocked, ignored, and caught (see signal(7)).
640
641 * CapInh, CapPrm, CapEff: Masks of capabilities enabled in
642 inheritable, permitted, and effective sets (see capabili‐
643 ties(7)).
644
645 * CapBnd: Capability Bounding set (since kernel 2.6.26, see
646 capabilities(7)).
647
648 * Cpus_allowed: Mask of CPUs on which this process may run
649 (since Linux 2.6.24, see cpuset(7)).
650
651 * Cpus_allowed_list: Same as previous, but in "list format"
652 (since Linux 2.6.26, see cpuset(7)).
653
654 * Mems_allowed: Mask of memory nodes allowed to this process
655 (since Linux 2.6.24, see cpuset(7)).
656
657 * Mems_allowed_list: Same as previous, but in "list format"
658 (since Linux 2.6.26, see cpuset(7)).
659
660 * voluntary_context_switches, nonvoluntary_context_switches:
661 Number of voluntary and involuntary context switches (since
662 Linux 2.6.23).
663
664 /proc/[pid]/task (since Linux 2.6.0-test6)
665 This is a directory that contains one subdirectory for each
666 thread in the process. The name of each subdirectory is the
667 numerical thread ID ([tid]) of the thread (see gettid(2)).
668 Within each of these subdirectories, there is a set of files
669 with the same names and contents as under the /proc/[pid] direc‐
670 tories. For attributes that are shared by all threads, the con‐
671 tents for each of the files under the task/[tid] subdirectories
672 will be the same as in the corresponding file in the parent
673 /proc/[pid] directory (e.g., in a multithreaded process, all of
674 the task/[tid]/cwd files will have the same value as the
675 /proc/[pid]/cwd file in the parent directory, since all of the
676 threads in a process share a working directory). For attributes
677 that are distinct for each thread, the corresponding files under
678 task/[tid] may have different values (e.g., various fields in
679 each of the task/[tid]/status files may be different for each
680 thread).
681
682 In a multithreaded process, the contents of the /proc/[pid]/task
683 directory are not available if the main thread has already ter‐
684 minated (typically by calling pthread_exit(3)).
685
686 /proc/apm
687 Advanced power management version and battery information when
688 CONFIG_APM is defined at kernel compilation time.
689
690 /proc/bus
691 Contains subdirectories for installed busses.
692
693 /proc/bus/pccard
694 Subdirectory for PCMCIA devices when CONFIG_PCMCIA is set at
695 kernel compilation time.
696
697 /proc/bus/pccard/drivers
698
699 /proc/bus/pci
700 Contains various bus subdirectories and pseudo-files containing
701 information about PCI busses, installed devices, and device
702 drivers. Some of these files are not ASCII.
703
704 /proc/bus/pci/devices
705 Information about PCI devices. They may be accessed through
706 lspci(8) and setpci(8).
707
708 /proc/cmdline
709 Arguments passed to the Linux kernel at boot time. Often done
710 via a boot manager such as lilo(8) or grub(8).
711
712 /proc/config.gz (since Linux 2.6)
713 This file exposes the configuration options that were used to
714 build the currently running kernel, in the same format as they
715 would be shown in the .config file that resulted when configur‐
716 ing the kernel (using make xconfig, make config, or similar).
717 The file contents are compressed; view or search them using
718 zcat(1), zgrep(1), etc. As long as no changes have been made to
719 the following file, the contents of /proc/config.gz are the same
720 as those provided by :
721
722 cat /lib/modules/$(uname -r)/build/.config
723
724 /proc/config.gz is only provided if the kernel is configured
725 with CONFIG_IKCONFIG_PROC.
726
727 /proc/cpuinfo
728 This is a collection of CPU and system architecture dependent
729 items, for each supported architecture a different list. Two
730 common entries are processor which gives CPU number and
731 bogomips; a system constant that is calculated during kernel
732 initialization. SMP machines have information for each CPU.
733
734 /proc/devices
735 Text listing of major numbers and device groups. This can be
736 used by MAKEDEV scripts for consistency with the kernel.
737
738 /proc/diskstats (since Linux 2.5.69)
739 This file contains disk I/O statistics for each disk device.
740 See the kernel source file Documentation/iostats.txt for further
741 information.
742
743 /proc/dma
744 This is a list of the registered ISA DMA (direct memory access)
745 channels in use.
746
747 /proc/driver
748 Empty subdirectory.
749
750 /proc/execdomains
751 List of the execution domains (ABI personalities).
752
753 /proc/fb
754 Frame buffer information when CONFIG_FB is defined during kernel
755 compilation.
756
757 /proc/filesystems
758 A text listing of the file systems which are supported by the
759 kernel, namely file systems which were compiled into the kernel
760 or whose kernel modules are currently loaded. (See also
761 filesystems(5).) If a file system is marked with "nodev", this
762 means that it does not require a block device to be mounted
763 (e.g., virtual file system, network file system).
764
765 Incidentally, this file may be used by mount(8) when no file
766 system is specified and it didn't manage to determine the file
767 system type. Then file systems contained in this file are tried
768 (excepted those that are marked with "nodev").
769
770 /proc/fs
771 Empty subdirectory.
772
773 /proc/ide
774 This directory exists on systems with the IDE bus. There are
775 directories for each IDE channel and attached device. Files
776 include:
777
778 cache buffer size in KB
779 capacity number of sectors
780 driver driver version
781 geometry physical and logical geometry
782 identify in hexadecimal
783 media media type
784 model manufacturer's model number
785 settings drive settings
786 smart_thresholds in hexadecimal
787 smart_values in hexadecimal
788
789 The hdparm(8) utility provides access to this information in a
790 friendly format.
791
792 /proc/interrupts
793 This is used to record the number of interrupts per CPU per IO
794 device. Since Linux 2.6.24, for the i386 and x86_64 architec‐
795 tures, at least, this also includes interrupts internal to the
796 system (that is, not associated with a device as such), such as
797 NMI (nonmaskable interrupt), LOC (local timer interrupt), and
798 for SMP systems, TLB (TLB flush interrupt), RES (rescheduling
799 interrupt), CAL (remote function call interrupt), and possibly
800 others. Very easy to read formatting, done in ASCII.
801
802 /proc/iomem
803 I/O memory map in Linux 2.4.
804
805 /proc/ioports
806 This is a list of currently registered Input-Output port regions
807 that are in use.
808
809 /proc/kallsyms (since Linux 2.5.71)
810 This holds the kernel exported symbol definitions used by the
811 modules(X) tools to dynamically link and bind loadable modules.
812 In Linux 2.5.47 and earlier, a similar file with slightly dif‐
813 ferent syntax was named ksyms.
814
815 /proc/kcore
816 This file represents the physical memory of the system and is
817 stored in the ELF core file format. With this pseudo-file, and
818 an unstripped kernel (/usr/src/linux/vmlinux) binary, GDB can be
819 used to examine the current state of any kernel data structures.
820
821 The total length of the file is the size of physical memory
822 (RAM) plus 4KB.
823
824 /proc/kmsg
825 This file can be used instead of the syslog(2) system call to
826 read kernel messages. A process must have superuser privileges
827 to read this file, and only one process should read this file.
828 This file should not be read if a syslog process is running
829 which uses the syslog(2) system call facility to log kernel mes‐
830 sages.
831
832 Information in this file is retrieved with the dmesg(8) program.
833
834 /proc/ksyms (Linux 1.1.23-2.5.47)
835 See /proc/kallsyms.
836
837 /proc/loadavg
838 The first three fields in this file are load average figures
839 giving the number of jobs in the run queue (state R) or waiting
840 for disk I/O (state D) averaged over 1, 5, and 15 minutes. They
841 are the same as the load average numbers given by uptime(1) and
842 other programs. The fourth field consists of two numbers sepa‐
843 rated by a slash (/). The first of these is the number of cur‐
844 rently executing kernel scheduling entities (processes,
845 threads); this will be less than or equal to the number of CPUs.
846 The value after the slash is the number of kernel scheduling
847 entities that currently exist on the system. The fifth field is
848 the PID of the process that was most recently created on the
849 system.
850
851 /proc/locks
852 This file shows current file locks (flock(2) and fcntl(2)) and
853 leases (fcntl(2)).
854
855 /proc/malloc (only up to and including Linux 2.2)
856 This file is only present if CONFIG_DEBUG_MALLOC was defined
857 during compilation.
858
859 /proc/meminfo
860 This file reports statistics about memory usage on the system.
861 It is used by free(1) to report the amount of free and used mem‐
862 ory (both physical and swap) on the system as well as the shared
863 memory and buffers used by the kernel.
864
865 /proc/modules
866 A text list of the modules that have been loaded by the system.
867 See also lsmod(8).
868
869 /proc/mounts
870 Before kernel 2.4.19, this file was a list of all the file sys‐
871 tems currently mounted on the system. With the introduction of
872 per-process mount namespaces in Linux 2.4.19, this file became a
873 link to /proc/self/mounts, which lists the mount points of the
874 process's own mount namespace. The format of this file is docu‐
875 mented in fstab(5).
876
877 /proc/mtrr
878 Memory Type Range Registers. See the kernel source file Docu‐
879 mentation/mtrr.txt for details.
880
881 /proc/net
882 various net pseudo-files, all of which give the status of some
883 part of the networking layer. These files contain ASCII struc‐
884 tures and are, therefore, readable with cat(1). However, the
885 standard netstat(8) suite provides much cleaner access to these
886 files.
887
888 /proc/net/arp
889 This holds an ASCII readable dump of the kernel ARP table used
890 for address resolutions. It will show both dynamically learned
891 and pre-programmed ARP entries. The format is:
892
893 IP address HW type Flags HW address Mask Device
894 192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0
895 192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0
896
897 Here "IP address" is the IPv4 address of the machine and the "HW
898 type" is the hardware type of the address from RFC 826. The
899 flags are the internal flags of the ARP structure (as defined in
900 /usr/include/linux/if_arp.h) and the "HW address" is the data
901 link layer mapping for that IP address if it is known.
902
903 /proc/net/dev
904 The dev pseudo-file contains network device status information.
905 This gives the number of received and sent packets, the number
906 of errors and collisions and other basic statistics. These are
907 used by the ifconfig(8) program to report device status. The
908 format is:
909
910 Inter-| Receive | Transmit
911 face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
912 lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0
913 eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0
914 ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0
915 tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0
916
917 /proc/net/dev_mcast
918 Defined in /usr/src/linux/net/core/dev_mcast.c:
919 indx interface_name dmi_u dmi_g dmi_address
920 2 eth0 1 0 01005e000001
921 3 eth1 1 0 01005e000001
922 4 eth2 1 0 01005e000001
923
924 /proc/net/igmp
925 Internet Group Management Protocol. Defined in
926 /usr/src/linux/net/core/igmp.c.
927
928 /proc/net/rarp
929 This file uses the same format as the arp file and contains the
930 current reverse mapping database used to provide rarp(8) reverse
931 address lookup services. If RARP is not configured into the
932 kernel, this file will not be present.
933
934 /proc/net/raw
935 Holds a dump of the RAW socket table. Much of the information
936 is not of use apart from debugging. The "sl" value is the ker‐
937 nel hash slot for the socket, the "local_address" is the local
938 address and protocol number pair. "St" is the internal status
939 of the socket. The "tx_queue" and "rx_queue" are the outgoing
940 and incoming data queue in terms of kernel memory usage. The
941 "tr", "tm->when", and "rexmits" fields are not used by RAW. The
942 "uid" field holds the effective UID of the creator of the
943 socket.
944
945 /proc/net/snmp
946 This file holds the ASCII data needed for the IP, ICMP, TCP, and
947 UDP management information bases for an SNMP agent.
948
949 /proc/net/tcp
950 Holds a dump of the TCP socket table. Much of the information
951 is not of use apart from debugging. The "sl" value is the ker‐
952 nel hash slot for the socket, the "local_address" is the local
953 address and port number pair. The "rem_address" is the remote
954 address and port number pair (if connected). "St" is the inter‐
955 nal status of the socket. The "tx_queue" and "rx_queue" are the
956 outgoing and incoming data queue in terms of kernel memory
957 usage. The "tr", "tm->when", and "rexmits" fields hold internal
958 information of the kernel socket state and are only useful for
959 debugging. The "uid" field holds the effective UID of the cre‐
960 ator of the socket.
961
962 /proc/net/udp
963 Holds a dump of the UDP socket table. Much of the information
964 is not of use apart from debugging. The "sl" value is the ker‐
965 nel hash slot for the socket, the "local_address" is the local
966 address and port number pair. The "rem_address" is the remote
967 address and port number pair (if connected). "St" is the inter‐
968 nal status of the socket. The "tx_queue" and "rx_queue" are the
969 outgoing and incoming data queue in terms of kernel memory
970 usage. The "tr", "tm->when", and "rexmits" fields are not used
971 by UDP. The "uid" field holds the effective UID of the creator
972 of the socket. The format is:
973
974 sl local_address rem_address st tx_queue rx_queue tr rexmits tm->when uid
975 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0
976 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0
977 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0
978
979 /proc/net/unix
980 Lists the Unix domain sockets present within the system and
981 their status. The format is:
982 Num RefCount Protocol Flags Type St Path
983 0: 00000002 00000000 00000000 0001 03
984 1: 00000001 00000000 00010000 0001 01 /dev/printer
985
986 Here "Num" is the kernel table slot number, "RefCount" is the
987 number of users of the socket, "Protocol" is currently always 0,
988 "Flags" represent the internal kernel flags holding the status
989 of the socket. Currently, type is always "1" (Unix domain data‐
990 gram sockets are not yet supported in the kernel). "St" is the
991 internal state of the socket and Path is the bound path (if any)
992 of the socket.
993
994 /proc/partitions
995 Contains major and minor numbers of each partition as well as
996 number of blocks and partition name.
997
998 /proc/pci
999 This is a listing of all PCI devices found during kernel ini‐
1000 tialization and their configuration.
1001
1002 This file has been deprecated in favor of a new /proc interface
1003 for PCI (/proc/bus/pci). It became optional in Linux 2.2
1004 (available with CONFIG_PCI_OLD_PROC set at kernel compilation).
1005 It became once more non-optionally enabled in Linux 2.4. Next,
1006 it was deprecated in Linux 2.6 (still available with CON‐
1007 FIG_PCI_LEGACY_PROC set), and finally removed altogether since
1008 Linux 2.6.17.
1009
1010 /proc/scsi
1011 A directory with the scsi mid-level pseudo-file and various SCSI
1012 low-level driver directories, which contain a file for each SCSI
1013 host in this system, all of which give the status of some part
1014 of the SCSI IO subsystem. These files contain ASCII structures
1015 and are, therefore, readable with cat(1).
1016
1017 You can also write to some of the files to reconfigure the sub‐
1018 system or switch certain features on or off.
1019
1020 /proc/scsi/scsi
1021 This is a listing of all SCSI devices known to the kernel. The
1022 listing is similar to the one seen during bootup. scsi cur‐
1023 rently supports only the add-single-device command which allows
1024 root to add a hotplugged device to the list of known devices.
1025
1026 The command
1027
1028 echo 'scsi add-single-device 1 0 5 0' > /proc/scsi/scsi
1029
1030 will cause host scsi1 to scan on SCSI channel 0 for a device on
1031 ID 5 LUN 0. If there is already a device known on this address
1032 or the address is invalid, an error will be returned.
1033
1034 /proc/scsi/[drivername]
1035 [drivername] can currently be NCR53c7xx, aha152x, aha1542,
1036 aha1740, aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000,
1037 pas16, qlogic, scsi_debug, seagate, t128, u15-24f, ultrastore,
1038 or wd7000. These directories show up for all drivers that reg‐
1039 istered at least one SCSI HBA. Every directory contains one
1040 file per registered host. Every host-file is named after the
1041 number the host was assigned during initialization.
1042
1043 Reading these files will usually show driver and host configura‐
1044 tion, statistics, etc.
1045
1046 Writing to these files allows different things on different
1047 hosts. For example, with the latency and nolatency commands,
1048 root can switch on and off command latency measurement code in
1049 the eata_dma driver. With the lockup and unlock commands, root
1050 can control bus lockups simulated by the scsi_debug driver.
1051
1052 /proc/self
1053 This directory refers to the process accessing the /proc file
1054 system, and is identical to the /proc directory named by the
1055 process ID of the same process.
1056
1057 /proc/slabinfo
1058 Information about kernel caches. Since Linux 2.6.16 this file
1059 is only present if the CONFIG_SLAB kernel configuration option
1060 is enabled. The columns in /proc/slabinfo are:
1061
1062 cache-name
1063 num-active-objs
1064 total-objs
1065 object-size
1066 num-active-slabs
1067 total-slabs
1068 num-pages-per-slab
1069
1070 See slabinfo(5) for details.
1071
1072 /proc/stat
1073 kernel/system statistics. Varies with architecture. Common
1074 entries include:
1075
1076 cpu 3357 0 4313 1362393
1077 The amount of time, measured in units of USER_HZ
1078 (1/100ths of a second on most architectures, use
1079 sysconf(_SC_CLK_TCK) to obtain the right value), that the
1080 system spent in user mode, user mode with low priority
1081 (nice), system mode, and the idle task, respectively.
1082 The last value should be USER_HZ times the second entry
1083 in the uptime pseudo-file.
1084
1085 In Linux 2.6 this line includes three additional columns:
1086 iowait - time waiting for I/O to complete (since 2.5.41);
1087 irq - time servicing interrupts (since 2.6.0-test4);
1088 softirq - time servicing softirqs (since 2.6.0-test4).
1089
1090 Since Linux 2.6.11, there is an eighth column, steal -
1091 stolen time, which is the time spent in other operating
1092 systems when running in a virtualized environment
1093
1094 Since Linux 2.6.24, there is a ninth column, guest, which
1095 is the time spent running a virtual CPU for guest operat‐
1096 ing systems under the control of the Linux kernel.
1097
1098 page 5741 1808
1099 The number of pages the system paged in and the number
1100 that were paged out (from disk).
1101
1102 swap 1 0
1103 The number of swap pages that have been brought in and
1104 out.
1105
1106 intr 1462898
1107 This line shows counts of interrupts serviced since boot
1108 time, for each of the possible system interrupts. The
1109 first column is the total of all interrupts serviced;
1110 each subsequent column is the total for a particular
1111 interrupt.
1112
1113 disk_io: (2,0):(31,30,5764,1,2) (3,0):...
1114 (major,disk_idx):(noinfo, read_io_ops, blks_read,
1115 write_io_ops, blks_written)
1116 (Linux 2.4 only)
1117
1118 ctxt 115315
1119 The number of context switches that the system underwent.
1120
1121 btime 769041601
1122 boot time, in seconds since the Epoch (January 1, 1970).
1123
1124 processes 86031
1125 Number of forks since boot.
1126
1127 procs_running 6
1128 Number of processes in runnable state. (Linux 2.5.45
1129 onwards.)
1130
1131 procs_blocked 2
1132 Number of processes blocked waiting for I/O to complete.
1133 (Linux 2.5.45 onwards.)
1134
1135 /proc/swaps
1136 Swap areas in use. See also swapon(8).
1137
1138 /proc/sys
1139 This directory (present since 1.3.57) contains a number of files
1140 and subdirectories corresponding to kernel variables. These
1141 variables can be read and sometimes modified using the /proc
1142 file system, and the (deprecated) sysctl(2) system call.
1143 Presently, there are subdirectories abi, debug, dev, fs, kernel,
1144 net, proc, rxrpc, sunrpc and vm that each contain more files and
1145 subdirectories.
1146
1147 /proc/sys/abi (since Linux 2.4.10)
1148 This directory may contain files with application binary infor‐
1149 mation. See the kernel source file Documentation/sysctl/abi.txt
1150 for more information.
1151
1152 /proc/sys/debug
1153 This directory may be empty.
1154
1155 /proc/sys/dev
1156 This directory contains device-specific information (e.g.,
1157 dev/cdrom/info). On some systems, it may be empty.
1158
1159 /proc/sys/fs
1160 This contains the subdirectories binfmt_misc, epoll, inotify,
1161 and mqueue, and files dentry-state, dir-notify-enable, dquot-nr,
1162 file-max, file-nr, inode-max, inode-nr, inode-state, lease-
1163 break-time, leases-enable, overflowgid, overflowuid,
1164 suid_dumpable, super-max, and super-nr.
1165
1166 /proc/sys/fs/binfmt_misc
1167 Documentation for files in this directory can be found in the
1168 kernel sources in Documentation/binfmt_misc.txt.
1169
1170 /proc/sys/fs/dentry-state (since Linux 2.2)
1171 This file contains information about the status of the directory
1172 cache (dcache). The file contains six numbers, nr_dentry,
1173 nr_unused, age_limit (age in seconds), want_pages (pages
1174 requested by system) and two dummy values.
1175
1176 * nr_dentry is the number of allocated dentries (dcache
1177 entries). This field is unused in Linux 2.2.
1178
1179 * nr_unused is the number of unused dentries.
1180
1181 * age_limit is the age in seconds after which dcache entries can
1182 be reclaimed when memory is short.
1183
1184 * want_pages is non-zero when the kernel has called
1185 shrink_dcache_pages() and the dcache isn't pruned yet.
1186
1187 /proc/sys/fs/dir-notify-enable
1188 This file can be used to disable or enable the dnotify interface
1189 described in fcntl(2) on a system-wide basis. A value of 0 in
1190 this file disables the interface, and a value of 1 enables it.
1191
1192 /proc/sys/fs/dquot-max
1193 This file shows the maximum number of cached disk quota entries.
1194 On some (2.4) systems, it is not present. If the number of free
1195 cached disk quota entries is very low and you have some awesome
1196 number of simultaneous system users, you might want to raise the
1197 limit.
1198
1199 /proc/sys/fs/dquot-nr
1200 This file shows the number of allocated disk quota entries and
1201 the number of free disk quota entries.
1202
1203 /proc/sys/fs/epoll (since Linux 2.6.28)
1204 This directory contains the file max_user_watches, which can be
1205 used to limit the amount of kernel memory consumed by the epoll
1206 interface. For further details, see inotify(7).
1207
1208 /proc/sys/fs/file-max
1209 This file defines a system-wide limit on the number of open
1210 files for all processes. (See also setrlimit(2), which can be
1211 used by a process to set the per-process limit, RLIMIT_NOFILE,
1212 on the number of files it may open.) If you get lots of error
1213 messages about running out of file handles, try increasing this
1214 value:
1215
1216 echo 100000 > /proc/sys/fs/file-max
1217
1218 The kernel constant NR_OPEN imposes an upper limit on the value
1219 that may be placed in file-max.
1220
1221 If you increase /proc/sys/fs/file-max, be sure to increase
1222 /proc/sys/fs/inode-max to 3-4 times the new value of
1223 /proc/sys/fs/file-max, or you will run out of inodes.
1224
1225 /proc/sys/fs/file-nr
1226 Historically, the kernel was able to allocate file handles
1227 dynamically, but not to free them again. The three values in
1228 file-nr denote the number of allocated file handles, the number
1229 of allocated but unused file handles, and the maximum number of
1230 file handles. Linux 2.6 always reports 0 as the number of free
1231 file handles -- this is not an error, it just means that the
1232 number of allocated file handles exactly matches the number of
1233 used file handles.
1234
1235 /proc/sys/fs/inode-max
1236 This file contains the maximum number of in-memory inodes. On
1237 some (2.4) systems, it may not be present. This value should be
1238 3-4 times larger than the value in file-max, since stdin, stdout
1239 and network sockets also need an inode to handle them. When you
1240 regularly run out of inodes, you need to increase this value.
1241
1242 /proc/sys/fs/inode-nr
1243 This file contains the first two values from inode-state.
1244
1245 /proc/sys/fs/inode-state
1246 This file contains seven numbers: nr_inodes, nr_free_inodes,
1247 preshrink, and four dummy values. nr_inodes is the number of
1248 inodes the system has allocated. This can be slightly more than
1249 inode-max because Linux allocates them one page full at a time.
1250 nr_free_inodes represents the number of free inodes. preshrink
1251 is non-zero when the nr_inodes > inode-max and the system needs
1252 to prune the inode list instead of allocating more.
1253
1254 /proc/sys/fs/inotify (since Linux 2.6.13)
1255 This directory contains files max_queued_events,
1256 max_user_instances, and max_user_watches, that can be used to
1257 limit the amount of kernel memory consumed by the inotify inter‐
1258 face. For further details, see inotify(7).
1259
1260 /proc/sys/fs/lease-break-time
1261 This file specifies the grace period that the kernel grants to a
1262 process holding a file lease (fcntl(2)) after it has sent a sig‐
1263 nal to that process notifying it that another process is waiting
1264 to open the file. If the lease holder does not remove or down‐
1265 grade the lease within this grace period, the kernel forcibly
1266 breaks the lease.
1267
1268 /proc/sys/fs/leases-enable
1269 This file can be used to enable or disable file leases
1270 (fcntl(2)) on a system-wide basis. If this file contains the
1271 value 0, leases are disabled. A non-zero value enables leases.
1272
1273 /proc/sys/fs/mqueue (since Linux 2.6.6)
1274 This directory contains files msg_max, msgsize_max, and
1275 queues_max, controlling the resources used by POSIX message
1276 queues. See mq_overview(7) for details.
1277
1278 /proc/sys/fs/overflowgid and /proc/sys/fs/overflowuid
1279 These files allow you to change the value of the fixed UID and
1280 GID. The default is 65534. Some file systems only support
1281 16-bit UIDs and GIDs, although in Linux UIDs and GIDs are 32
1282 bits. When one of these file systems is mounted with writes
1283 enabled, any UID or GID that would exceed 65535 is translated to
1284 the overflow value before being written to disk.
1285
1286 /proc/sys/fs/suid_dumpable (since Linux 2.6.13)
1287 The value in this file determines whether core dump files are
1288 produced for set-user-ID or otherwise protected/tainted bina‐
1289 ries. Three different integer values can be specified:
1290
1291 0 (default) This provides the traditional (pre-Linux 2.6.13)
1292 behavior. A core dump will not be produced for a process which
1293 has changed credentials (by calling seteuid(2), setgid(2), or
1294 similar, or by executing a set-user-ID or set-group-ID program)
1295 or whose binary does not have read permission enabled.
1296
1297 1 ("debug") All processes dump core when possible. The core
1298 dump is owned by the file system user ID of the dumping process
1299 and no security is applied. This is intended for system debug‐
1300 ging situations only. Ptrace is unchecked.
1301
1302 2 ("suidsafe") Any binary which normally would not be dumped
1303 (see "0" above) is dumped readable by root only. This allows
1304 the user to remove the core dump file but not to read it. For
1305 security reasons core dumps in this mode will not overwrite one
1306 another or other files. This mode is appropriate when adminis‐
1307 trators are attempting to debug problems in a normal environ‐
1308 ment.
1309
1310 /proc/sys/fs/super-max
1311 This file controls the maximum number of superblocks, and thus
1312 the maximum number of mounted file systems the kernel can have.
1313 You only need to increase super-max if you need to mount more
1314 file systems than the current value in super-max allows you to.
1315
1316 /proc/sys/fs/super-nr
1317 This file contains the number of file systems currently mounted.
1318
1319 /proc/sys/kernel
1320 This directory contains files controlling a range of kernel
1321 parameters, as described below.
1322
1323 /proc/sys/kernel/acct
1324 This file contains three numbers: highwater, lowwater, and fre‐
1325 quency. If BSD-style process accounting is enabled these values
1326 control its behavior. If free space on file system where the
1327 log lives goes below lowwater percent accounting suspends. If
1328 free space gets above highwater percent accounting resumes.
1329 frequency determines how often the kernel checks the amount of
1330 free space (value is in seconds). Default values are 4, 2 and
1331 30. That is, suspend accounting if 2% or less space is free;
1332 resume it if 4% or more space is free; consider information
1333 about amount of free space valid for 30 seconds.
1334
1335 /proc/sys/kernel/cap-bound (from Linux 2.2 to 2.6.24)
1336 This file holds the value of the kernel capability bounding set
1337 (expressed as a signed decimal number). This set is ANDed
1338 against the capabilities permitted to a process during
1339 execve(2). Starting with Linux 2.6.25, the system-wide capabil‐
1340 ity bounding set disappeared, and was replaced by a per-thread
1341 bounding set; see capabilities(7).
1342
1343 /proc/sys/kernel/core_pattern
1344 See core(5).
1345
1346 /proc/sys/kernel/core_uses_pid
1347 See core(5).
1348
1349 /proc/sys/kernel/ctrl-alt-del
1350 This file controls the handling of Ctrl-Alt-Del from the key‐
1351 board. When the value in this file is 0, Ctrl-Alt-Del is
1352 trapped and sent to the init(8) program to handle a graceful
1353 restart. When the value is greater than zero, Linux's reaction
1354 to a Vulcan Nerve Pinch (tm) will be an immediate reboot, with‐
1355 out even syncing its dirty buffers. Note: when a program (like
1356 dosemu) has the keyboard in "raw" mode, the ctrl-alt-del is
1357 intercepted by the program before it ever reaches the kernel tty
1358 layer, and it's up to the program to decide what to do with it.
1359
1360 /proc/sys/kernel/hotplug
1361 This file contains the path for the hotplug policy agent. The
1362 default value in this file is /sbin/hotplug.
1363
1364 /proc/sys/kernel/domainname and /proc/sys/kernel/hostname
1365 can be used to set the NIS/YP domainname and the hostname of
1366 your box in exactly the same way as the commands domainname(1)
1367 and hostname(1), that is:
1368
1369 # echo 'darkstar' > /proc/sys/kernel/hostname
1370 # echo 'mydomain' > /proc/sys/kernel/domainname
1371
1372 has the same effect as
1373
1374 # hostname 'darkstar'
1375 # domainname 'mydomain'
1376
1377 Note, however, that the classic darkstar.frop.org has the host‐
1378 name "darkstar" and DNS (Internet Domain Name Server) domainname
1379 "frop.org", not to be confused with the NIS (Network Information
1380 Service) or YP (Yellow Pages) domainname. These two domain
1381 names are in general different. For a detailed discussion see
1382 the hostname(1) man page.
1383
1384 /proc/sys/kernel/htab-reclaim
1385 (PowerPC only) If this file is set to a non-zero value, the Pow‐
1386 erPC htab (see kernel file Documentation/powerpc/ppc_htab.txt)
1387 is pruned each time the system hits the idle loop.
1388
1389 /proc/sys/kernel/l2cr
1390 (PowerPC only) This file contains a flag that controls the L2
1391 cache of G3 processor boards. If 0, the cache is disabled.
1392 Enabled if non-zero.
1393
1394 /proc/sys/kernel/modprobe
1395 This file contains the path for the kernel module loader. The
1396 default value is /sbin/modprobe. The file is only present if
1397 the kernel is built with the CONFIG_KMOD option enabled. It is
1398 described by the kernel source file Documentation/kmod.txt (only
1399 present in kernel 2.4 and earlier).
1400
1401 /proc/sys/kernel/msgmax
1402 This file defines a system-wide limit specifying the maximum
1403 number of bytes in a single message written on a System V mes‐
1404 sage queue.
1405
1406 /proc/sys/kernel/msgmni
1407 This file defines the system-wide limit on the number of message
1408 queue identifiers. (This file is only present in Linux 2.4
1409 onwards.)
1410
1411 /proc/sys/kernel/msgmnb
1412 This file defines a system-wide parameter used to initialize the
1413 msg_qbytes setting for subsequently created message queues. The
1414 msg_qbytes setting specifies the maximum number of bytes that
1415 may be written to the message queue.
1416
1417 /proc/sys/kernel/ostype and /proc/sys/kernel/osrelease
1418 These files give substrings of /proc/version.
1419
1420 /proc/sys/kernel/overflowgid and /proc/sys/kernel/overflowuid
1421 These files duplicate the files /proc/sys/fs/overflowgid and
1422 /proc/sys/fs/overflowuid.
1423
1424 /proc/sys/kernel/panic
1425 This file gives read/write access to the kernel variable
1426 panic_timeout. If this is zero, the kernel will loop on a
1427 panic; if non-zero it indicates that the kernel should autore‐
1428 boot after this number of seconds. When you use the software
1429 watchdog device driver, the recommended setting is 60.
1430
1431 /proc/sys/kernel/panic_on_oops (since Linux 2.5.68)
1432 This file controls the kernel's behavior when an oops or BUG is
1433 encountered. If this file contains 0, then the system tries to
1434 continue operation. If it contains 1, then the system delays a
1435 few seconds (to give klogd time to record the oops output) and
1436 then panics. If the /proc/sys/kernel/panic file is also non-
1437 zero then the machine will be rebooted.
1438
1439 /proc/sys/kernel/pid_max( since Linux 2.5.34)
1440 This file specifies the value at which PIDs wrap around (i.e.,
1441 the value in this file is one greater than the maximum PID).
1442 The default value for this file, 32768, results in the same
1443 range of PIDs as on earlier kernels. On 32-bit platforms, 32768
1444 is the maximum value for pid_max. On 64-bit systems, pid_max
1445 can be set to any value up to 2^22 (PID_MAX_LIMIT, approximately
1446 4 million).
1447
1448 /proc/sys/kernel/powersave-nap (PowerPC only)
1449 This file contains a flag. If set, Linux-PPC will use the "nap"
1450 mode of powersaving, otherwise the "doze" mode will be used.
1451
1452 /proc/sys/kernel/printk
1453 The four values in this file are console_loglevel, default_mes‐
1454 sage_loglevel, minimum_console_level, and default_con‐
1455 sole_loglevel. These values influence printk() behavior when
1456 printing or logging error messages. See syslog(2) for more info
1457 on the different loglevels. Messages with a higher priority
1458 than console_loglevel will be printed to the console. Messages
1459 without an explicit priority will be printed with priority
1460 default_message_level. minimum_console_loglevel is the minimum
1461 (highest) value to which console_loglevel can be set.
1462 default_console_loglevel is the default value for con‐
1463 sole_loglevel.
1464
1465 /proc/sys/kernel/pty (since Linux 2.6.4)
1466 This directory contains two files relating to the number of Unix
1467 98 pseudo-terminals (see pts(4)) on the system.
1468
1469 /proc/sys/kernel/pty/max
1470 This file defines the maximum number of pseudo-terminals.
1471
1472 /proc/sys/kernel/pty/nr
1473 This read-only file indicates how many pseudo-terminals are cur‐
1474 rently in use.
1475
1476 /proc/sys/kernel/random
1477 This directory contains various parameters controlling the oper‐
1478 ation of the file /dev/random. See random(4) for further infor‐
1479 mation.
1480
1481 /proc/sys/kernel/real-root-dev
1482 This file is documented in the kernel source file Documenta‐
1483 tion/initrd.txt.
1484
1485 /proc/sys/kernel/reboot-cmd (Sparc only)
1486 This file seems to be a way to give an argument to the SPARC
1487 ROM/Flash boot loader. Maybe to tell it what to do after
1488 rebooting?
1489
1490 /proc/sys/kernel/rtsig-max
1491 (Only in kernels up to and including 2.6.7; see setrlimit(2))
1492 This file can be used to tune the maximum number of POSIX real-
1493 time (queued) signals that can be outstanding in the system.
1494
1495 /proc/sys/kernel/rtsig-nr
1496 (Only in kernels up to and including 2.6.7.) This file shows
1497 the number POSIX real-time signals currently queued.
1498
1499 /proc/sys/kernel/sem (since Linux 2.4)
1500 This file contains 4 numbers defining limits for System V IPC
1501 semaphores. These fields are, in order:
1502
1503 SEMMSL The maximum semaphores per semaphore set.
1504
1505 SEMMNS A system-wide limit on the number of semaphores in all
1506 semaphore sets.
1507
1508 SEMOPM The maximum number of operations that may be specified
1509 in a semop(2) call.
1510
1511 SEMMNI A system-wide limit on the maximum number of semaphore
1512 identifiers.
1513
1514 /proc/sys/kernel/sg-big-buff
1515 This file shows the size of the generic SCSI device (sg) buffer.
1516 You can't tune it just yet, but you could change it at compile
1517 time by editing include/scsi/sg.h and changing the value of
1518 SG_BIG_BUFF. However, there shouldn't be any reason to change
1519 this value.
1520
1521 /proc/sys/kernel/shmall
1522 This file contains the system-wide limit on the total number of
1523 pages of System V shared memory.
1524
1525 /proc/sys/kernel/shmmax
1526 This file can be used to query and set the run-time limit on the
1527 maximum (System V IPC) shared memory segment size that can be
1528 created. Shared memory segments up to 1GB are now supported in
1529 the kernel. This value defaults to SHMMAX.
1530
1531 /proc/sys/kernel/shmmni
1532 (available in Linux 2.4 and onwards) This file specifies the
1533 system-wide maximum number of System V shared memory segments
1534 that can be created.
1535
1536 /proc/sys/kernel/sysrq
1537 This file controls the functions allowed to be invoked by the
1538 SysRq key. By default, the file contains 1 meaning that every
1539 possible SysRq request is allowed (in older kernel versions,
1540 SysRq was disabled by default, and you were required to specifi‐
1541 cally enable it at run-time, but this is not the case any more).
1542 Possible values in this file are:
1543
1544 0 - disable sysrq completely
1545 1 - enable all functions of sysrq
1546 >1 - bitmask of allowed sysrq functions, as follows:
1547 2 - enable control of console logging level
1548 4 - enable control of keyboard (SAK, unraw)
1549 8 - enable debugging dumps of processes etc.
1550 16 - enable sync command
1551 32 - enable remount read-only
1552 64 - enable signalling of processes (term, kill, oom-
1553 kill)
1554 128 - allow reboot/poweroff
1555 256 - allow nicing of all real-time tasks
1556
1557 This file is only present if the CONFIG_MAGIG_SYSRQ kernel con‐
1558 figuration option is enabled. For further details see the ker‐
1559 nel source file Documentation/sysrq.txt.
1560
1561 /proc/sys/kernel/version
1562 This file contains a string like:
1563
1564 #5 Wed Feb 25 21:49:24 MET 1998
1565
1566 The "#5" means that this is the fifth kernel built from this
1567 source base and the date behind it indicates the time the kernel
1568 was built.
1569
1570 /proc/sys/kernel/threads-max (since Linux 2.3.11)
1571 This file specifies the system-wide limit on the number of
1572 threads (tasks) that can be created on the system.
1573
1574 /proc/sys/kernel/zero-paged (PowerPC only)
1575 This file contains a flag. When enabled (non-zero), Linux-PPC
1576 will pre-zero pages in the idle loop, possibly speeding up
1577 get_free_pages.
1578
1579 /proc/sys/net
1580 This directory contains networking stuff. Explanations for some
1581 of the files under this directory can be found in tcp(7) and
1582 ip(7).
1583
1584 /proc/sys/net/core/somaxconn
1585 This file defines a ceiling value for the backlog argument of
1586 listen(2); see the listen(2) manual page for details.
1587
1588 /proc/sys/proc
1589 This directory may be empty.
1590
1591 /proc/sys/sunrpc
1592 This directory supports Sun remote procedure call for network
1593 file system (NFS). On some systems, it is not present.
1594
1595 /proc/sys/vm
1596 This directory contains files for memory management tuning, buf‐
1597 fer and cache management.
1598
1599 /proc/sys/vm/drop_caches (since Linux 2.6.16)
1600 Writing to this file causes the kernel to drop clean caches,
1601 dentries and inodes from memory, causing that memory to become
1602 free.
1603
1604 To free pagecache, use echo 1 > /proc/sys/vm/drop_caches; to
1605 free dentries and inodes, use echo 2 > /proc/sys/vm/drop_caches;
1606 to free pagecache, dentries and inodes, use echo 3 >
1607 /proc/sys/vm/drop_caches.
1608
1609 Because this is a non-destructive operation and dirty objects
1610 are not freeable, the user should run sync(8) first.
1611
1612 /proc/sys/vm/swappiness
1613 The value in this file controls how aggressively the kernel will
1614 swap memory pages. Higher values increase agressiveness, lower
1615 values descrease aggressiveness. The default value is 60.
1616
1617 /proc/sys/vm/legacy_va_layout (since Linux 2.6.9)
1618 If non-zero, this disables the new 32-bit memory-mapping layout;
1619 the kernel will use the legacy (2.4) layout for all processes.
1620
1621 /proc/sys/vm/oom_dump_tasks (since Linux 2.6.25)
1622 Enables a system-wide task dump (excluding kernel threads) to be
1623 produced when the kernel performs an OOM-killing. The dump
1624 includes the following information for each task (thread,
1625 process): thread ID, real user ID, thread group ID (process ID),
1626 virtual memory size, resident set size, the CPU that the task is
1627 scheduled on, oom_adj score (see the description of
1628 /proc/[pid]/oom_adj), and command name. This is helpful to
1629 determine why the OOM-killer was invoked and to identify the
1630 rogue task that caused it.
1631
1632 If this contains the value zero, this information is suppressed.
1633 On very large systems with thousands of tasks, it may not be
1634 feasible to dump the memory state information for each one.
1635 Such systems should not be forced to incur a performance penalty
1636 in OOM situations when the information may not be desired.
1637
1638 If this is set to non-zero, this information is shown whenever
1639 the OOM-killer actually kills a memory-hogging task.
1640
1641 The default value is 0.
1642
1643 /proc/sys/vm/oom_kill_allocating_task (since Linux 2.6.24)
1644 This enables or disables killing the OOM-triggering task in out-
1645 of-memory situations.
1646
1647 If this is set to zero, the OOM-killer will scan through the
1648 entire tasklist and select a task based on heuristics to kill.
1649 This normally selects a rogue memory-hogging task that frees up
1650 a large amount of memory when killed.
1651
1652 If this is set to non-zero, the OOM-killer simply kills the task
1653 that triggered the out-of-memory condition. This avoids a pos‐
1654 sibly expensive tasklist scan.
1655
1656 If /proc/sys/vm/panic_on_oom is non-zero, it takes precedence
1657 over whatever value is used in /proc/sys/vm/oom_kill_allocat‐
1658 ing_task.
1659
1660 The default value is 0.
1661
1662 /proc/sys/vm/overcommit_memory
1663 This file contains the kernel virtual memory accounting mode.
1664 Values are:
1665
1666 0: heuristic overcommit (this is the default)
1667 1: always overcommit, never check
1668 2: always check, never overcommit
1669
1670 In mode 0, calls of mmap(2) with MAP_NORESERVE are not checked,
1671 and the default check is very weak, leading to the risk of get‐
1672 ting a process "OOM-killed". Under Linux 2.4 any non-zero value
1673 implies mode 1. In mode 2 (available since Linux 2.6), the
1674 total virtual address space on the system is limited to (SS +
1675 RAM*(r/100)), where SS is the size of the swap space, and RAM is
1676 the size of the physical memory, and r is the contents of the
1677 file /proc/sys/vm/overcommit_ratio.
1678
1679 /proc/sys/vm/overcommit_ratio
1680 See the description of /proc/sys/vm/overcommit_memory.
1681
1682 /proc/sys/vm/panic_on_oom (since Linux 2.6.18)
1683 This enables or disables a kernel panic in an out-of-memory sit‐
1684 uation.
1685
1686 If this file is set to the value 0, the kernel's OOM-killer will
1687 kill some rogue process. Usually, the OOM-killer is able to
1688 kill a rogue process and the system will survive.
1689
1690 If this file is set to the value 1, then the kernel normally
1691 panics when out-of-memory happens. However, if a process limits
1692 allocations to certain nodes using memory policies (mbind(2)
1693 MPOL_BIND) or cpusets (cpuset(7)) and those nodes reach memory
1694 exhaustion status, one process may be killed by the OOM-killer.
1695 No panic occurs in this case: because other nodes' memory may be
1696 free, this means the system as a whole may not have reached an
1697 out-of-memory situation yet.
1698
1699 If this file is set to the value 2, the kernel always panics
1700 when an out-of-memory condition occurs.
1701
1702 The default value is 0. 1 and 2 are for failover of clustering.
1703 Select either according to your policy of failover.
1704
1705 /proc/sysrq-trigger (since Linux 2.4.21)
1706 Writing a character to this file triggers the same SysRq func‐
1707 tion as typing ALT-SysRq-<character> (see the description of
1708 /proc/sys/kernel/sysrq). This file is normally only writable by
1709 root. For further details see the kernel source file Documenta‐
1710 tion/sysrq.txt.
1711
1712 /proc/sysvipc
1713 Subdirectory containing the pseudo-files msg, sem and shm.
1714 These files list the System V Interprocess Communication (IPC)
1715 objects (respectively: message queues, semaphores, and shared
1716 memory) that currently exist on the system, providing similar
1717 information to that available via ipcs(1). These files have
1718 headers and are formatted (one IPC object per line) for easy
1719 understanding. svipc(7) provides further background on the
1720 information shown by these files.
1721
1722 /proc/tty
1723 Subdirectory containing the pseudo-files and subdirectories for
1724 tty drivers and line disciplines.
1725
1726 /proc/uptime
1727 This file contains two numbers: the uptime of the system (sec‐
1728 onds), and the amount of time spent in idle process (seconds).
1729
1730 /proc/version
1731 This string identifies the kernel version that is currently run‐
1732 ning. It includes the contents of /proc/sys/kernel/ostype,
1733 /proc/sys/kernel/osrelease and /proc/sys/kernel/version. For
1734 example:
1735 Linux version 1.0.9 (quinlan@phaze) #1 Sat May 14 01:51:54 EDT 1994
1736
1737 /proc/vmstat (since Linux 2.6)
1738 This file displays various virtual memory statistics.
1739
1740 /proc/zoneinfo (since Linux 2.6.13)
1741 This file display information about memory zones. This is use‐
1742 ful for analyzing virtual memory behavior.
1743
1745 Many strings (i.e., the environment and command line) are in the inter‐
1746 nal format, with sub-fields terminated by null bytes ('\0'), so you may
1747 find that things are more readable if you use od -c or tr "\000" "\n"
1748 to read them. Alternatively, echo `cat <file>` works well.
1749
1750 This manual page is incomplete, possibly inaccurate, and is the kind of
1751 thing that needs to be updated very often.
1752
1754 cat(1), find(1), free(1), ps(1), tr(1), uptime(1), chroot(2), mmap(2),
1755 readlink(2), syslog(2), slabinfo(5), hier(7), time(7), arp(8),
1756 dmesg(8), hdparm(8), ifconfig(8), init(8), lsmod(8), lspci(8),
1757 mount(8), netstat(8), procinfo(8), route(8)
1758 The kernel source files: Documentation/filesystems/proc.txt, Documenta‐
1759 tion/sysctl/vm.txt
1760
1762 This page is part of release 3.22 of the Linux man-pages project. A
1763 description of the project, and information about reporting bugs, can
1764 be found at http://www.kernel.org/doc/man-pages/.
1765
1766
1767
1768Linux 2009-03-30 PROC(5)