]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/proc.5
sync
[thirdparty/man-pages.git] / man5 / proc.5
CommitLineData
fea681da 1.\" Copyright (C) 1994, 1995 by Daniel Quinlan (quinlan@yggdrasil.com)
b4e9ee8f 2.\" and Copyright (C) 2002-2008 Michael Kerrisk <mtk.manpages@gmail.com>
fea681da
MK
3.\" with networking additions from Alan Cox (A.Cox@swansea.ac.uk)
4.\" and scsi additions from Michael Neuffer (neuffer@mail.uni-mainz.de)
5.\" and sysctl additions from Andries Brouwer (aeb@cwi.nl)
6.\" and System V IPC (as well as various other) additions from
c11b1abf 7.\" Michael Kerrisk <mtk.manpages@gmail.com>
fea681da
MK
8.\"
9.\" This is free documentation; you can redistribute it and/or
10.\" modify it under the terms of the GNU General Public License as
11.\" published by the Free Software Foundation; either version 2 of
12.\" the License, or (at your option) any later version.
13.\"
14.\" The GNU General Public License's references to "object code"
15.\" and "executables" are to be interpreted as the output of any
16.\" document formatting or typesetting system, including
17.\" intermediate and printed output.
18.\"
19.\" This manual is distributed in the hope that it will be useful,
20.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
21.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22.\" GNU General Public License for more details.
23.\"
24.\" You should have received a copy of the GNU General Public
25.\" License along with this manual; if not, write to the Free
26.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
27.\" USA.
28.\"
29.\" Modified 1995-05-17 by faith@cs.unc.edu
30.\" Minor changes by aeb and Marty Leisner (leisner@sdsp.mc.xerox.com).
31.\" Modified 1996-04-13, 1996-07-22 by aeb@cwi.nl
32.\" Modified 2001-12-16 by rwhron@earthlink.net
33.\" Modified 2002-07-13 by jbelton@shaw.ca
34.\" Modified 2002-07-22, 2003-05-27, 2004-04-06, 2004-05-25
c11b1abf 35.\" by Michael Kerrisk <mtk.manpages@gmail.com>
5d6d14a0
MK
36.\" 2004-11-17, mtk -- updated notes on /proc/loadavg
37.\" 2004-12-01, mtk, rtsig-max and rtsig-nr went away in 2.6.8
568105c6
MK
38.\" 2004-12-14, mtk, updated 'statm', and fixed error in order of list
39.\" 2005-05-12, mtk, updated 'stat'
6d64ca9c 40.\" 2005-07-13, mtk, added /proc/sys/fs/mqueue/*
363f747c
MK
41.\" 2005-09-16, mtk, Added /proc/sys/fs/suid_dumpable
42.\" 2005-09-19, mtk, added /proc/zoneinfo
b4e9ee8f 43.\" 2005-03-01, mtk, moved /proc/sys/fs/mqueue/* material to mq_overview.7.
16b5f7ba 44.\" 2008-06-05, mtk, Added /proc/PID/oom_score, /proc/PID/oom_adj,
a1d5601b 45.\" /proc/PID/limits, /proc/PID/mountinfo, /proc/PID/mounstats,
b4e9ee8f 46.\" and /proc/PID/fdinfo/*.
16b5f7ba 47.\" 2008-06-19, mtk, Documented /proc/PID/status.
363f747c 48.\"
b07b19c4
MK
49.\" FIXME 2.6.14 has /proc/PID/numa_maps (if CONFIG_NUMA is
50.\" enabled); this needs to be documented.
c13182ef 51.\" Info on numa_maps can be found in the patch-2.6.14
b07b19c4 52.\" Changelog, but this is possibly not up to date.
8cf9de1b 53.\"
c533af9d 54.\" FIXME 2.6.13 seems to have /proc/vmcore implemented
c13182ef
MK
55.\" in the source code, but there is no option available under
56.\" 'make xconfig'; eventually this should be fixed, and then info
57.\" from the patch-2.6.13 and change log could be used to write an
c533af9d 58.\" entry in this man page.
8cf9de1b 59.\"
c13182ef
MK
60.\" FIXME cross check against Documentation/filesystems/proc.txt
61.\" to see what information could be imported from that file
c533af9d 62.\" into this file.
fea681da 63.\"
b4e9ee8f 64.TH PROC 5 2008-06-22 "Linux" "Linux Programmer's Manual"
fea681da 65.SH NAME
24d01c53 66proc \- process information pseudo-file system
fea681da
MK
67.SH DESCRIPTION
68The
69.I proc
24d01c53 70file system is a pseudo-file system which is used as an interface to
c13182ef
MK
71kernel data structures.
72It is commonly mounted at
fea681da 73.IR /proc .
c13182ef 74Most of it is read-only, but some files allow kernel variables to be
fea681da
MK
75changed.
76.LP
77The following outline gives a quick tour through the /proc hierarchy.
78.PD 1
79.TP
80.I /proc/[number]
81There is a numerical subdirectory for each running process; the
82subdirectory is named by the process ID.
83Each such subdirectory contains the following
84pseudo-files and directories.
b4e9ee8f
MK
85.\" FIXME Describe /proc/[number]/attr and
86.\" /proc/PID/task/TID/attr
87.\" This is a directory
88.\" Added in ???
89.\" CONFIG_SECURITY
90.\"
fea681da 91.TP
857f1942
MK
92.IR /proc/[number]/auxv " (since 2.6.0-test7)"
93This contains the contents of the ELF interpreter information passed
c13182ef 94to the process at exec time.
857f1942 95The format is one \fIunsigned long\fP ID
c13182ef 96plus one \fIunsigned long\fP value for each entry.
857f1942 97The last entry contains two zeros.
b4e9ee8f
MK
98.\" FIXME Describe /proc/[number]/cgroup and
99.\" /proc/PID/task/TID/cgroup
100.\" Info in Documentation/cgroups.txt
101.\" Added in 2.6.24
102.\" CONFIG_CGROUPS
103.\"
104.\" FIXME Describe /proc/[number]/clear_refs
105.\" Added in 2.6.22
106.\" "Clears page referenced bits shown in smaps output"
107.\" write-only
108.\" CONFIG_PROC_PAGE_MONITOR
857f1942 109.TP
fea681da 110.I /proc/[number]/cmdline
b447cd58
MK
111This holds the complete command line for the process,
112unless the process is a zombie.
113.\" In 2.3.26, this also used to be true if the process was swapped out.
114In the latter case, there is nothing in this file:
75b94dc3 115that is, a read on this file will return 0 characters.
b447cd58 116The command-line arguments appear in this file as a set of
fea681da
MK
117null-separated strings, with a further null byte after the last string.
118.TP
b4e9ee8f
MK
119.IR /proc/[number]/coredump_filter " (since kernel 2.6.23)"
120See
121.BR core (5).
28f2c98d
MK
122.TP
123.IR /proc/[number]/cpuset " (since kernel 2.6.12)"
124.\" and/proc/PID/task/TID/cpuset
125See
126.BR cpuset (7).
b4e9ee8f 127.TP
fea681da 128.I /proc/[number]/cwd
c13182ef 129This is a symbolic link to the current working directory of the process.
afcaf646 130To find out the cwd of process 20, for instance, you can do this:
fea681da
MK
131
132.br
133.nf
134.ft CW
135cd /proc/20/cwd; /bin/pwd
136.fi
137.ft
138
c13182ef
MK
139Note that the
140.I pwd
e7b489f0 141command is often a shell built-in, and might
c13182ef
MK
142not work properly.
143In bash, you may use pwd \-P.
afcaf646
MK
144
145.\" The following was still true as at kernel 2.6.13
c13182ef
MK
146In a multithreaded process, the contents of this symbolic link
147are not available if the main thread has already terminated
afcaf646
MK
148(typically by calling
149.BR pthread_exit (3).
fea681da
MK
150.TP
151.I /proc/[number]/environ
152This file contains the environment for the process.
f81fb444 153The entries are separated by null bytes (\(aq\\0\(aq),
b4e9ee8f 154and there may be a null byte at the end.
fea681da 155Thus, to print out the environment of process 1, you would do:
a08ea57c 156.in +4n
fea681da 157.nf
a08ea57c 158
fea681da
MK
159.ft CW
160(cat /proc/1/environ; echo) | tr "\\000" "\\n"
161.fi
162.ft P
a08ea57c 163.in
fea681da
MK
164
165(For a reason why one should want to do this, see
f41d1d3d
MK
166.BR lilo (8)
167or
168.BR grub (8).)
fea681da
MK
169.TP
170.I /proc/[number]/exe
171Under Linux 2.2 and later, this file is a symbolic link
2d7195b8 172containing the actual pathname of the executed command.
c13182ef
MK
173This symbolic link can be dereferenced normally; attempting to open
174it will open the executable.
175You can even type
fea681da 176.I /proc/[number]/exe
c13182ef 177to run another copy of the same executable as is being run by
6931a324 178process [number].
afcaf646 179.\" The following was still true as at kernel 2.6.13
c13182ef
MK
180In a multithreaded process, the contents of this symbolic link
181are not available if the main thread has already terminated
afcaf646
MK
182(typically by calling
183.BR pthread_exit (3)).
fea681da
MK
184
185Under Linux 2.0 and earlier
186.I /proc/[number]/exe
c13182ef
MK
187is a pointer to the binary which was executed,
188and appears as a symbolic link.
189A
fea681da
MK
190.BR readlink (2)
191call on this file under Linux 2.0 returns a string in the format:
192
193[device]:inode
194
195For example, [0301]:1502 would be inode 1502 on device major 03 (IDE,
196MFM, etc. drives) minor 01 (first partition on the first drive).
197
198.BR find (1)
4d9b6984 199with the \-inum option can be used to locate the file.
fea681da
MK
200.TP
201.I /proc/[number]/fd
202This is a subdirectory containing one entry for each file which the
203process has open, named by its file descriptor, and which is a
c13182ef
MK
204symbolic link to the actual file.
205Thus, 0 is standard input, 1 standard output, 2 standard error, etc.
fea681da 206
afcaf646
MK
207.\" The following was still true as at kernel 2.6.13
208In a multithreaded process, the contents of this directory
c13182ef 209are not available if the main thread has already terminated
afcaf646
MK
210(typically by calling
211.BR pthread_exit (3)).
212
fea681da
MK
213Programs that will take a filename, but will not take the standard
214input, and which write to a file, but will not send their output to
4d9b6984
MK
215standard output, can be effectively foiled this way, assuming that \-i
216is the flag designating an input file and \-o is the flag designating
fea681da 217an output file:
a08ea57c 218.in +4n
fea681da
MK
219.nf
220
2bc2f479 221\f(CWfoobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ...\fR
fea681da 222.fi
a08ea57c
MK
223.in
224
fea681da
MK
225and you have a working filter.
226.\" The following is not true in my tests (MTK):
227.\" Note that this will not work for
228.\" programs that seek on their files, as the files in the fd directory
229.\" are not seekable.
230
231/proc/self/fd/N is approximately the same as /dev/fd/N in some UNIX
c13182ef
MK
232and UNIX-like systems.
233Most Linux MAKEDEV scripts symbolically link
fea681da 234/dev/fd to /proc/self/fd, in fact.
6aefb6df 235.\" FIXME Describe /proc/[number]/loginuid
b877b392 236.\" Added in 2.6.11; updating requires CAP_AUDIT_CONTROL
b4e9ee8f
MK
237.\" CONFIG_AUDITSYSCALL
238.TP
239.I /proc/[number]/fdinfo/ " (since kernel 2.6.22)"
240This is a subdirectory containing one entry for each file which the
241process has open, named by its file descriptor.
242The contents of each file can be read to obtain information
243about the corresponding file descriptor, for example:
244.in +4n
245.nf
246
247$ cat /proc/12015/fdinfo/4
248pos: 1000
249flags: 01002002
250.fi
251.in
252
253The
254.I pos
255field is a decimal number showing the current file offset.
256The
257.I flags
258field is an octal number that displays the
259file access mode and file status flags (see
260.BR open (2)).
261
262The files in this directory are readable only by the owner of the process.
263.\" FIXME document /proc/[number]/io
264.\" .TP
265.\" .IR /proc/[number]/io " (since kernel 2.6.20)"
266.TP
267.IR /proc/[number]/limits " (since kernel 2.6.24)"
268This file displays the soft limit, hard limit, and units of measurement
269for each of the process's resource limits (see
270.BR getrlimit (2).
271The file is protected to only allow reading by the real UID of the process.
fea681da
MK
272.TP
273.I /proc/[number]/maps
274A file containing the currently mapped memory regions and their access
275permissions.
276
277The format is:
278
279.nf
280.ft CW
281.in 8n
282address perms offset dev inode pathname
28308048000-08056000 r-xp 00000000 03:0c 64593 /usr/sbin/gpm
28408056000-08058000 rw-p 0000d000 03:0c 64593 /usr/sbin/gpm
28508058000-0805b000 rwxp 00000000 00:00 0
28640000000-40013000 r-xp 00000000 03:0c 4165 /lib/ld-2.2.4.so
28740013000-40015000 rw-p 00012000 03:0c 4165 /lib/ld-2.2.4.so
2884001f000-40135000 r-xp 00000000 03:0c 45494 /lib/libc-2.2.4.so
28940135000-4013e000 rw-p 00115000 03:0c 45494 /lib/libc-2.2.4.so
2904013e000-40142000 rw-p 00000000 00:00 0
291bffff000-c0000000 rwxp 00000000 00:00 0
292.ft
293.fi
294.in
295
296where address is the address space in the process that it occupies,
297perms is a set of permissions:
298
299.nf
300.in +5
301r = read
302w = write
303x = execute
304s = shared
305p = private (copy on write)
306.fi
307.in
308
309offset is the offset into the file/whatever, dev is the device
310(major:minor), and inode is the inode on that device. 0 indicates
311that no inode is associated with the memory region, as the case would
312be with bss.
313
314Under Linux 2.0 there is no field giving pathname.
315.TP
316.I /proc/[number]/mem
317This file can be used to access the pages of a process's memory through
318.BR open (2),
319.BR read (2),
320and
ccb2bb0d 321.BR lseek (2).
bd4b0ce7
MK
322.\" FIXME Describe /proc/[number]/mountinfo and
323.\" /proc/PID/task/TID/mountinfo
324.\" Info in Documentation/filesystems/proc.txt
325.\" Added in 2.6.26
326.\"
b4e9ee8f
MK
327.TP
328.IR /proc/[number]/mountinfo " (since Linux 2.6.26)"
329.\" This info adapted from Documentation/filesystems/proc.txt
330This file contains information about mount points.
331It contains lines of the form:
332.nf
333.ft CW
334.in 8n
335
33636 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue
337(1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11)
338.in
339.ft
340.fi
341.IP
342The numbers in parentheses are labels for the descriptions below:
343.RS 12
344.TP 5
345(1)
346mount ID: unique identifier of the mount (may be reused after
347.BR umount (2)).
348.TP
349(2)
350parent ID: ID of parent mount (or of self for the top of the mount tree).
351.TP
352(3)
353major:minor: value of
354.I st_dev
355for files on file system (see
356.BR stat (2)).
357.TP
358(4)
359root: root of the mount within the file system.
360.TP
361(5)
362mount point: mount point relative to the process's root.
363.TP
364(6)
365mount options: per-mount options.
366.TP
367(7)
368optional fields: zero or more fields of the form "tag[:value]".
369.TP
370(8)
371separator: marks the end of the optional fields.
372.TP
373(9)
374file system type: name of file system in the form "type[.subtype]".
375.TP
376(10)
377mount source: file system-specific information or "none".
378.TP
379(11)
380super options: per-super block options.
381.RE
382.IP
383Parsers should ignore all unrecognized optional fields.
384Currently the possible optional fields are:
385.RS 12
386.TP 18
387shared:X
388mount is shared in peer group X
389.TP
390master:X
391mount is slave to peer group X
392.TP
393propagate_from:X
394mount is slave and receives propagation from peer group X (*)
395.TP
396unbindable
397mount is unbindable
398.RE
399.IP
400(*) X is the closest dominant peer group under the process's root.
401If X is the immediate master of the mount,
402or if there is no dominant peer group under the same root,
403then only the "master:X" field is present
404and not the "propagate_from:X" field.
405
406For more information on mount propagation see:
407.I Documentation/filesystems/sharedsubtree.txt
408in the kernel source tree.
409.TP
410.IR /proc/[number]/mountstats " (since Linux 2.6.17)"
411This file system exports information (statistics, configuration information)
412about the mount points in the process's name space.
413Lines in this file have the form:
414.nf
415
416device /dev/sda7 mounted on /home with fstype ext3 [statistics]
417( 1 ) ( 2 ) (3 ) (4)
418.fi
419.IP
420The fields in each line are:
421.RS 12
422.TP 5
423(1)
424The name of the mounted device
425(or "nodevice" if there is no corresponding device).
426.TP
427(2)
428The mount point within the file system tree.
429.TP
430(3)
431The file system type.
432.TP
433(4)
434Optional statistics and configuration information.
435Currently (as at Linux 2.6.26), only NFS file systems export
436information via this field.
437.RE
438.IP
439This file is only readable by the owner of the process.
440.\"
441.\" FIXME Describe /proc/[number]/mountstats and
442.\" /proc/PID/task/TID/mountstats
443.\" Some information can be found in the 2.6.17 change log.
444.\" Added in 2.6.17
445.\"
446.TP
447.IR /proc/[number]/oom_adj " (since Linux 2.6.11)"
448.\" FIXME . probably the discussion of MAP_NORESERVE in mmap.2
449.\" should point to the discussion of oom_adj and oom_score in this page.
450This file can be used to adjust the score used to select which process
451should be killed in an out-of-memory (OOM) situation.
452The kernel uses this value for a bit-shift operation of the process's
453.IR oom_score
454value:
455valid values are in the range -16 to +15,
456plus the special value -17,
457which disables OOM-killing altogether for this process.
458A positive score increases the likelihood of this
459process being killed by the OOM-killer;
460a negative score decreases the likelihood.
461The default value for this file is 0;
462a new process inherits its parent's
463.I oom_adj
464setting.
465A process must be privileged
466.RB ( CAP_SYS_RESOURCE )
467to update this file.
468.TP
469.IR /proc/[number]/oom_score " (since Linux 2.6.11)"
470.\" See mm/oom_kill.c::badness() in the 2.6.25 sources
471This file displays the current score that the kernel gives to
472this process for the purpose of selecting a process
473for the OOM-killer.
474A higher score means that the process is more likely to be
475selected by the OOM-killer.
476The basis for this score is the amount of memory used by the process,
477with increases (+) or decreases (\-) for factors including:
478.\" See mm/oom_kill.c::badness() in the 2.6.25 sources
479.RS
480.IP * 2
481whether the process creates a lot of children using
482.BR fork (2)
483(+);
484.IP *
485whether the process has been running a long time,
486or has used a lot of CPU time (\-);
487.IP *
488whether the process has a low nice value (i.e., > 0) (+);
489.IP *
490whether the process is privileged (\-); and
491.\" More precisely, if it has CAP_SYS_ADMIN or CAP_SYS_RESOURCE
492.IP *
493whether the process is making direct hardware access (\-).
494.\" More precisely, if it has CAP_SYS_RAWIO
495.RE
496.IP
497The
498.I oom_score
499also reflects the bit-shift adjustment specified by the
500.I oom_adj
501setting for the process.
502.\" FIXME Describe /proc/[number]/pagemap
503.\" Added in 2.6.25
504.\" CONFIG_PROC_PAGE_MONITOR
fea681da
MK
505.TP
506.I /proc/[number]/root
507Unix and Linux support the idea of a per-process root of the
24d01c53 508file system, set by the
fea681da 509.BR chroot (2)
c13182ef
MK
510system call.
511This file is a symbolic link that points to the process's
fea681da 512root directory, and behaves as exe, fd/*, etc. do.
afcaf646
MK
513
514.\" The following was still true as at kernel 2.6.13
c13182ef
MK
515In a multithreaded process, the contents of this symbolic link
516are not available if the main thread has already terminated
afcaf646
MK
517(typically by calling
518.BR pthread_exit (3)).
6aefb6df
MK
519.\" FIXME Describe /proc/[number]/seccomp
520.\" Added in 2.6.12
b4e9ee8f
MK
521.\" FIXME Describe /proc/[number]/sessionid
522.\" Added in 2.6.25; read-only; only readable by real UID
523.\" CONFIG_AUDITSYSCALL
524.\" FIXME Describe /proc/[number]/sched
525.\" Added in 2.6.23
526.\" CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS
527.\" Displays various scheduling parameters
528.\" This file can be written, to reset stats
529.\" FIXME Describe /proc/[number]/schedstats and
530.\" /proc/[number]/task/TID/schedstats
531.\" Added in 2.6.9
532.\" CONFIG_SCHEDSTATS
fea681da 533.TP
b07b19c4 534.IR /proc/[number]/smaps " (since Linux 2.6.14)"
b4e9ee8f 535.\" CONFIG_PROC_PAGE_MONITOR
b07b19c4
MK
536This file shows memory consumption for each of the process's mappings.
537For each of mappings there is a series of lines as follows:
a08ea57c 538.in +4n
b07b19c4
MK
539.nf
540
54108048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash
542Size: 464 kB
543Rss: 424 kB
544Shared_Clean: 424 kB
545Shared_Dirty: 0 kB
546Private_Clean: 0 kB
547Private_Dirty: 0 kB
548
549.fi
a08ea57c 550.in
b07b19c4
MK
551The first of these lines shows the same information as is displayed
552for the mapping in
553.IR /proc/[number]/maps .
554The remaining lines show the size of the mapping,
555the amount of the mapping that is currently resident in RAM,
556the number clean and dirty shared pages in the mapping,
557and the number clean and dirty private pages in the mapping.
558
097585ed
MK
559This file is only present if the
560.B CONFIG_MMU
561kernel configuration
b07b19c4
MK
562option is enabled.
563.TP
fea681da 564.I /proc/[number]/stat
c13182ef
MK
565Status information about the process.
566This is used by
567.BR ps (1).
568It is defined in
fea681da
MK
569.IR /usr/src/linux/fs/proc/array.c "."
570
571The fields, in order, with their proper
572.BR scanf (3)
573format specifiers, are:
574.RS
575.TP
576\fIpid\fP %d
357cf3fe 577The process ID.
fea681da
MK
578.TP
579\fIcomm\fP %s
c13182ef
MK
580The filename of the executable, in parentheses.
581This is visible whether or not the executable is swapped out.
fea681da
MK
582.TP
583\fIstate\fP %c
584One character from the string "RSDZTW" where R is running, S is
585sleeping in an interruptible wait, D is waiting in uninterruptible
586disk sleep, Z is zombie, T is traced or stopped (on a signal),
587and W is paging.
588.TP
589\fIppid\fP %d
590The PID of the parent.
591.TP
592\fIpgrp\fP %d
593The process group ID of the process.
594.TP
595\fIsession\fP %d
596The session ID of the process.
597.TP
598.\" tty_nr needs better explanation.
599\fItty_nr\fP %d
600The tty the process uses.
601.TP
602\fItpgid\fP %d
603.\" This field and following, up to and including wchan added 0.99.1
604The process group ID of the process which currently owns the tty that
605the process is connected to.
606.TP
2ebfeb1b 607\fIflags\fP %u (%lu before Linux 2.6.22)
c13182ef
MK
608The kernel flags word of the process.
609For bit meanings,
fea681da
MK
610see the PF_* defines in
611.IR <linux/sched.h> .
612Details depend on the kernel version.
613.TP
614\fIminflt\fP %lu
615The number of minor faults the process has made which have not
616required loading a memory page from disk.
617.TP
618\fIcminflt\fP %lu
619The number of minor faults that the process's
620waited-for children have made.
621.TP
622\fImajflt\fP %lu
623The number of major faults the process has made which have
624required loading a memory page from disk.
625.TP
626\fIcmajflt\fP %lu
627The number of major faults that the process's
628waited-for children have made.
629.TP
630\fIutime\fP %lu
631The number of jiffies that this process has been scheduled in user
632mode.
a1c9dc59
MK
633This includes guest time, \fIguest_time\fP
634(time spent running a virtual CPU, see below),
635so that applications that are not aware of the guest time field
636do not lose that time from their calculations.
fea681da
MK
637.TP
638\fIstime\fP %lu
639The number of jiffies that this process has been scheduled in kernel
640mode.
641.TP
642\fIcutime\fP %ld
643The number of jiffies that this process's
c13182ef
MK
644waited-for children have been scheduled in user mode.
645(See also
fea681da 646.BR times (2).)
a1c9dc59
MK
647This includes guest time, \fIcguest_time\fP
648(time spent running a virtual CPU, see below).
fea681da
MK
649.TP
650\fIcstime\fP %ld
651The number of jiffies that this process's
652waited-for children have been scheduled in kernel mode.
653.TP
654\fIpriority\fP %ld
c13182ef
MK
655The standard nice value, plus fifteen.
656The value is never negative in the kernel.
fea681da
MK
657.TP
658\fInice\fP %ld
8729177b 659The nice value ranges from 19 (nicest) to \-19 (not nice to others).
fea681da
MK
660.TP
661.\" .TP
662.\" \fIcounter\fP %ld
663.\" The current maximum size in jiffies of the process's next timeslice,
664.\" or what is currently left of its current timeslice, if it is the
665.\" currently running process.
666.\" .TP
667.\" \fItimeout\fP %u
668.\" The time in jiffies of the process's next timeout.
0e94f77b
MK
669.\" timeout was removed sometime around 2.1/2.2
670\fInum_threads\fP %ld
2ebfeb1b 671Number of threads in this process (since Linux 2.6).
bb83d1b9 672Before kernel 2.6, this field was hard coded to 0 as a placeholder
0e94f77b 673for an earlier removed field.
fea681da
MK
674.TP
675\fIitrealvalue\fP %ld
8bd58774
MK
676The time in jiffies before the next
677.B SIGALRM
678is sent to the process due to an interval timer.
0e94f77b
MK
679Since kernel 2.6.17, this field is no longer maintained,
680and is hard coded as 0.
fea681da 681.TP
0e94f77b 682\fIstarttime\fP %llu (was %lu before Linux 2.6)
fea681da
MK
683The time in jiffies the process started after system boot.
684.TP
685\fIvsize\fP %lu
686Virtual memory size in bytes.
687.TP
688\fIrss\fP %ld
689Resident Set Size: number of pages the process has in real memory,
c13182ef
MK
690minus 3 for administrative purposes.
691This is just the pages which
692count towards text, data, or stack space.
693This does not include pages
fea681da
MK
694which have not been demand-loaded in, or which are swapped out.
695.TP
696\fIrlim\fP %lu
697Current limit in bytes on the rss of the process (usually
6984294967295 on i386).
699.TP
700\fIstartcode\fP %lu
701The address above which program text can run.
702.TP
703\fIendcode\fP %lu
704The address below which program text can run.
705.TP
706\fIstartstack\fP %lu
707The address of the start of the stack.
708.TP
709\fIkstkesp\fP %lu
710The current value of esp (stack pointer), as found in the
711kernel stack page for the process.
712.TP
713\fIkstkeip\fP %lu
714The current EIP (instruction pointer).
715.TP
716\fIsignal\fP %lu
0c6085e0 717The bitmap of pending signals.
fea681da
MK
718.TP
719\fIblocked\fP %lu
0c6085e0 720The bitmap of blocked signals.
fea681da
MK
721.TP
722\fIsigignore\fP %lu
723The bitmap of ignored signals.
724.TP
725\fIsigcatch\fP %lu
0c6085e0 726The bitmap of caught signals.
fea681da
MK
727.TP
728\fIwchan\fP %lu
c13182ef
MK
729This is the "channel" in which the process is waiting.
730It is the
fea681da 731address of a system call, and can be looked up in a namelist if you
c13182ef 732need a textual name.
9a67332e
MK
733(If you have an up-to-date
734.IR /etc/psdatabase ,
735then
4d9b6984 736try \fIps \-l\fP to see the WCHAN field in action.)
fea681da
MK
737.TP
738\fInswap\fP %lu
0e94f77b 739.\" nswap was added in 2.0
4d9b6984 740Number of pages swapped (not maintained).
fea681da
MK
741.TP
742\fIcnswap\fP %lu
0e94f77b 743.\" cnswap was added in 2.0
4d9b6984 744Cumulative \fInswap\fP for child processes (not maintained).
fea681da 745.TP
2ebfeb1b 746\fIexit_signal\fP %d (since Linux 2.1.22)
fea681da
MK
747Signal to be sent to parent when we die.
748.TP
2ebfeb1b 749\fIprocessor\fP %d (since Linux 2.2.8)
fea681da 750CPU number last executed on.
568105c6 751.TP
2ebfeb1b 752\fIrt_priority\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
568105c6
MK
753Real-time scheduling priority (see
754.BR sched_setscheduler (2)).
755.TP
2ebfeb1b 756\fIpolicy\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
568105c6
MK
757Scheduling policy (see
758.BR sched_setscheduler (2)).
167450d6 759.TP
2ebfeb1b 760\fIdelayacct_blkio_ticks\fP %llu (since Linux 2.6.18)
0e94f77b 761Aggregated block I/O delays, measured in clock ticks (centiseconds).
14c06953
MK
762.TP
763\fIguest_time\fP %lu (since Linux 2.6.24)
764Guest time of the process (time spent running a virtual CPU
765for a guest operating system), in centiseconds.
766.TP
767\fIcguest_time\fP %ld (since Linux 2.6.24)
768Guest time of the process's children, in centiseconds.
fea681da
MK
769.RE
770.TP
771.I /proc/[number]/statm
c13182ef
MK
772Provides information about memory status in pages.
773The columns are:
a08ea57c
MK
774.in +4n
775.nf
776
777size total program size
778resident resident set size
779share shared pages
780text text (code)
781lib library
782data data/stack
783dt dirty pages (unused in Linux 2.6)
784.fi
785.in
fea681da
MK
786.TP
787.I /proc/[number]/status
788Provides much of the information in
789.I /proc/[number]/stat
790and
791.I /proc/[number]/statm
792in a format that's easier for humans to parse.
16b5f7ba
MK
793Here's an example:
794.in +4n
795.nf
796
797$ cat /proc/$$/status
798Name: bash
799State: S (sleeping)
800Tgid: 3515
801Pid: 3515
802PPid: 3452
803TracerPid: 0
804Uid: 1000 1000 1000 1000
805Gid: 100 100 100 100
806FDSize: 256
807Groups: 16 33 100
808VmPeak: 9136 kB
809VmSize: 7896 kB
810VmLck: 0 kB
811VmHWM: 7572 kB
812VmRSS: 6316 kB
813VmData: 5224 kB
814VmStk: 88 kB
815VmExe: 572 kB
816VmLib: 1708 kB
817VmPTE: 20 kB
818Threads: 1
819SigQ: 0/3067
820SigPnd: 0000000000000000
821ShdPnd: 0000000000000000
822SigBlk: 0000000000010000
823SigIgn: 0000000000384004
824SigCgt: 000000004b813efb
825CapInh: 0000000000000000
826CapPrm: 0000000000000000
827CapEff: 0000000000000000
828CapBnd: ffffffffffffffff
829Cpus_allowed: 00000001
830Cpus_allowed_list: 0
831Mems_allowed: 1
832Mems_allowed_list: 0
833voluntary_ctxt_switches: 150
834nonvoluntary_ctxt_switches: 545
835.fi
836.in
837.IP
838The fields are as follows:
839.RS
840.IP * 2
841.IR Name :
842Command run by this process.
843.IP *
844.IR State :
845Current state of the process. One of
846"R (running)",
847"S (sleeping)",
848"D (disk sleep)",
849"T (stopped)",
850"T (tracing stop)",
851"Z (zombie)",
852or
853"X (dead)".
854.IP *
855.IR Tgid :
856Thread group ID (i.e., Process ID).
857.IP *
858.IR Pid :
859Thread ID (see
860.BR gettid (2)).
861.IP *
862.IR TracerPid :
863PID of process tracing this process (0 if not being traced).
864.IP *
865.IR Uid ", " Gid :
866Real, effective, saved set, and file system UIDs (GIDs).
867.IP *
868.IR FDSize :
869Number of file descriptor slots currently allocated.
870.IP *
871.IR Groups :
872Supplementary group list.
873.IP *
874.IR VmPeak :
875Peak virtual memory size.
876.IP *
877.IR VmSize :
878Virtual memory size.
879.IP *
880.IR VmLck :
881Locked memory size.
882.IP *
883.IR VmHWM :
884Peak resident set size ("high water mark").
885.IP *
886.IR VmRSS :
887Resident set size.
888.IP *
889.IR VmData ", " VmStk ", " VmExe :
890Size of data, stack, and text segments.
891.IP *
892.IR VmLib :
893Shared library code size.
894.IP *
895.IR VmPTE :
896Page table entries size (since Linux 2.6.10).
897.IP *
898.IR Threads :
899Number of threads in process containing this thread.
900.IP *
901.IR SigPnd ", " ShdPnd :
902Number of signals pending for thread and for process as a whole (see
903.BR pthreads (7)
904and
905.BR signal (7)).
906.IP *
907.IR SigBlk ", " SigIgn ", " SigCgt :
908Masks indicating signals being blocked, ignored, and caught (see
909.BR signal (7)).
910.IP *
911.IR CapInh ", " CapPrm ", " CapEff :
912Masks of capabilities enabled in inheritable, permitted, and effective sets
913(see
914.BR capabilities (7)).
915.IP *
916.IR CapBnd :
917Capability Bounding set
918(since kernel 2.6.26, see
919.BR capabilities (7)).
920.IP *
921.IR Cpus_allowed :
922Mask of CPUs on which this process may run
923(since Linux 2.6.24, see
924.BR cpuset (7)).
925.IP *
926.IR Cpus_allowed_list :
927Same as previous, but in "list format"
928(since Linux 2.6.26, see
929.BR cpuset (7)).
930.IP *
931.IR Mems_allowed :
932Mask of memory nodes allowed to this process
933(since Linux 2.6.24, see
934.BR cpuset (7)).
935.IP *
936.IR Mems_allowed_list :
937Same as previous, but in "list format"
938(since Linux 2.6.26, see
939.BR cpuset (7)).
940.IP *
941.IR voluntary_context_switches ", " nonvoluntary_context_switches :
942Number of voluntary and involuntary context switches (since Linux 2.6.23).
943.RE
fea681da 944.TP
2ebfeb1b 945.IR /proc/[number]/task " (since Linux 2.6.0-test6)"
afcaf646
MK
946This is a directory that contains one subdirectory
947for each thread in the process.
948The name of each subdirectory is the numerical thread ID of the
949thread (see
950.BR gettid (2)).
951Within each of these subdirectories, there is a set of
952files with the same names and contents as under the
953.I /proc/[number]
954directories.
955For attributes that are shared by all threads, the contents for
956each of the files under the
957.I task/[thread-ID]
958subdirectories will be the same as in the corresponding
c13182ef 959file in the parent
afcaf646
MK
960.I /proc/[number]
961directory
c13182ef 962(e.g., in a multithreaded process, all of the
afcaf646 963.I task/[thread-ID]/cwd
c13182ef 964files will have the same value as the
afcaf646 965.I /proc/[number]/cwd
c13182ef 966file in the parent directory, since all of the threads in a process
afcaf646
MK
967share a working directory).
968For attributes that are distinct for each thread,
c13182ef 969the corresponding files under
afcaf646
MK
970.I task/[thread-ID]
971may have different values (e.g., various fields in each of the
972.I task/[thread-ID]/status
973files may be different for each thread).
974
975.\" The following was still true as at kernel 2.6.13
976In a multithreaded process, the contents of the
977.I /proc/[number]/task
c13182ef 978directory are not available if the main thread has already terminated
afcaf646
MK
979(typically by calling
980.BR pthread_exit (3)).
981.TP
fea681da 982.I /proc/apm
097585ed
MK
983Advanced power management version and battery information when
984.B CONFIG_APM
985is defined at kernel compilation time.
fea681da
MK
986.TP
987.I /proc/bus
988Contains subdirectories for installed busses.
989.TP
990.I /proc/bus/pccard
097585ed
MK
991Subdirectory for pcmcia devices when
992.B CONFIG_PCMCIA
993is set at kernel compilation time.
fea681da
MK
994.TP
995.I /proc/bus/pccard/drivers
996.TP
997.I /proc/bus/pci
c13182ef
MK
998Contains various bus subdirectories and pseudo-files containing
999information about pci busses, installed devices, and device
1000drivers.
1001Some of these files are not ASCII.
fea681da
MK
1002.TP
1003.I /proc/bus/pci/devices
c13182ef
MK
1004Information about pci devices.
1005They may be accessed through
fea681da
MK
1006.BR lspci (8)
1007and
1008.BR setpci (8).
1009.TP
1010.I /proc/cmdline
c13182ef
MK
1011Arguments passed to the Linux kernel at boot time.
1012Often done via a boot manager such as
fea681da 1013.BR lilo (1).
2bb6d7e6 1014.\" FIXME Document /proc/config.gz (new in kernel 2.6)
fea681da
MK
1015.TP
1016.I /proc/cpuinfo
1017This is a collection of CPU and system architecture dependent items,
1018for each supported architecture a different list.
1019Two common entries are \fIprocessor\fP which gives CPU number and
c13182ef
MK
1020\fIbogomips\fP; a system constant that is calculated
1021during kernel initialization.
1022SMP machines have information for
fea681da
MK
1023each CPU.
1024.TP
1025.I /proc/devices
c13182ef
MK
1026Text listing of major numbers and device groups.
1027This can be used by MAKEDEV scripts for consistency with the kernel.
fea681da
MK
1028.TP
1029.IR /proc/diskstats " (since Linux 2.5.69)"
1030This file contains disk I/O statistics for each disk device.
1031See the kernel source file
1032.I Documentation/iostats.txt
1033for further information.
1034.TP
1035.I /proc/dma
c13182ef 1036This is a list of the registered \fIISA\fP DMA (direct memory access)
fea681da
MK
1037channels in use.
1038.TP
1039.I /proc/driver
1040Empty subdirectory.
1041.TP
1042.I /proc/execdomains
1043List of the execution domains (ABI personalities).
1044.TP
1045.I /proc/fb
097585ed
MK
1046Frame buffer information when
1047.B CONFIG_FB
1048is defined during kernel compilation.
fea681da
MK
1049.TP
1050.I /proc/filesystems
24d01c53
MK
1051A text listing of the file systems which are supported by the kernel,
1052namely file systems which were compiled into the kernel or whose kernel
809d0164 1053modules are currently loaded. (See also
fb477da2 1054.BR filesystems (5).)
24d01c53 1055If a file system is marked with "nodev",
809d0164 1056this means that it does not require a block device to be mounted
24d01c53 1057(e.g., virtual file system, network file system).
809d0164
MK
1058
1059Incidentally, this file may be used by
1060.BR mount (8)
24d01c53
MK
1061when no file system is specified and it didn't manage to determine the
1062file system type.
1063Then file systems contained in this file are tried
809d0164 1064(excepted those that are marked with "nodev").
fea681da
MK
1065.TP
1066.I /proc/fs
1067Empty subdirectory.
1068.TP
1069.I /proc/ide
1070This directory
c13182ef
MK
1071exists on systems with the ide bus.
1072There are directories for each ide channel and attached device.
1073Files include:
fea681da 1074
a08ea57c 1075.in +4n
fea681da
MK
1076.nf
1077cache buffer size in KB
1078capacity number of sectors
1079driver driver version
1080geometry physical and logical geometry
9fdfa163 1081identify in hexadecimal
fea681da
MK
1082media media type
1083model manufacturer's model number
1084settings drive settings
9fdfa163
MK
1085smart_thresholds in hexadecimal
1086smart_values in hexadecimal
fea681da 1087.fi
a08ea57c 1088.in
fea681da 1089
c13182ef 1090The
fea681da
MK
1091.BR hdparm (8)
1092utility provides access to this information in a friendly format.
1093.TP
1094.I /proc/interrupts
1095This is used to record the number of interrupts per each IRQ on (at
c13182ef
MK
1096least) the i386 architecture.
1097Very easy to read formatting, done in
fea681da
MK
1098ASCII.
1099.TP
1100.I /proc/iomem
1101I/O memory map in Linux 2.4.
1102.TP
1103.I /proc/ioports
c13182ef 1104This is a list of currently registered Input-Output port regions that
fea681da
MK
1105are in use.
1106.TP
1107.IR /proc/kallsyms " (since Linux 2.5.71)"
1108This holds the kernel exported symbol definitions used by the
1109.BR modules (X)
1110tools to dynamically link and bind loadable modules.
1111In Linux 2.5.47 and earlier, a similar file with slightly different syntax
1112was named
1113.IR ksyms .
1114.TP
1115.I /proc/kcore
1116This file represents the physical memory of the system and is stored
c13182ef
MK
1117in the ELF core file format.
1118With this pseudo-file, and an unstripped
9a67332e
MK
1119kernel
1120.RI ( /usr/src/linux/vmlinux )
1121binary, GDB can be used to
fea681da
MK
1122examine the current state of any kernel data structures.
1123
1124The total length of the file is the size of physical memory (RAM) plus
11254KB.
1126.TP
1127.I /proc/kmsg
1128This file can be used instead of the
1129.BR syslog (2)
c13182ef
MK
1130system call to read kernel messages.
1131A process must have superuser
fea681da 1132privileges to read this file, and only one process should read this
c13182ef
MK
1133file.
1134This file should not be read if a syslog process is running
fea681da
MK
1135which uses the
1136.BR syslog (2)
1137system call facility to log kernel messages.
1138
1139Information in this file is retrieved with the
1140.BR dmesg (8)
1141program.
1142.TP
1143.IR /proc/ksyms " (Linux 1.1.23-2.5.47)"
1144See
1145.IR /proc/kallsyms .
1146.TP
1147.I /proc/loadavg
6b05dc38
MK
1148The first three fields in this file are load average figures
1149giving the number of jobs in the run queue (state R)
fea681da
MK
1150or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes.
1151They are the same as the load average numbers given by
1152.BR uptime (1)
1153and other programs.
6b05dc38
MK
1154The fourth field consists of two numbers separated by a slash (/).
1155The first of these is the number of currently executing kernel
c13182ef 1156scheduling entities (processes, threads);
6b05dc38
MK
1157this will be less than or equal to the number of CPUs.
1158The value after the slash is the number of kernel scheduling entities
1159that currently exist on the system.
1160The fifth field is the PID of the process that was most
1161recently created on the system.
fea681da
MK
1162.TP
1163.I /proc/locks
1164This file shows current file locks
1165.RB ( flock "(2) and " fcntl (2))
1166and leases
1167.RB ( fcntl (2)).
1168.TP
89dd5f8a 1169.IR /proc/malloc " (only up to and including Linux 2.2)"
097585ed 1170This file is only present if
89dd5f8a 1171.B CONFIG_DEBUG_MALLOC
097585ed 1172was defined during compilation.
fea681da
MK
1173.TP
1174.I /proc/meminfo
1175This is used by
1176.BR free (1)
1177to report the amount of free and used memory (both physical and swap)
1178on the system as well as the shared memory and buffers used by the
1179kernel.
1180
1181It is in the same format as
1182.BR free (1),
1183except in bytes rather than KB.
1184.TP
1185.I /proc/mounts
1186This is a list of all the file systems currently mounted on the system.
1187The format of this file is documented in
31e9a9ec 1188.BR fstab (5).
c13182ef 1189Since kernel version 2.6.15, this file is pollable:
57651c15
MK
1190after opening the file for reading, a change in this file
1191(i.e., a file system mount or unmount) causes
1192.BR select (2)
1193to mark the file descriptor as readable, and
1194.BR poll (2)
1195and
1196.BR epoll_wait (2)
1197mark the file as having an error condition.
fea681da
MK
1198.TP
1199.I /proc/modules
1200A text list of the modules that have been loaded by the system.
1201See also
1202.BR lsmod (8).
1203.TP
1204.I /proc/mtrr
c13182ef
MK
1205Memory Type Range Registers.
1206See
fea681da
MK
1207.I /usr/src/linux/Documentation/mtrr.txt
1208for details.
1209.TP
1210.I /proc/net
1211various net pseudo-files, all of which give the status of some part of
c13182ef
MK
1212the networking layer.
1213These files contain ASCII structures and are,
1214therefore, readable with cat.
1215However, the standard
fea681da
MK
1216.BR netstat (8)
1217suite provides much cleaner access to these files.
1218.TP
1219.I /proc/net/arp
1220This holds an ASCII readable dump of the kernel ARP table used for
c13182ef
MK
1221address resolutions.
1222It will show both dynamically learned and
1223pre-programmed ARP entries.
1224The format is:
fea681da
MK
1225
1226.nf
1227.ft CW
1228.in 8n
1229IP address HW type Flags HW address Mask Device
1230192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0
1231192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0
1232.ft
1233.fi
1234.in
1235
6c04f928 1236Here "IP address" is the IPv4 address of the machine and the "HW type"
c13182ef
MK
1237is the hardware type of the address from RFC\ 826.
1238The flags are the internal
9a67332e
MK
1239flags of the ARP structure (as defined in
1240.IR /usr/include/linux/if_arp.h )
1241and
6c04f928 1242the "HW address" is the data link layer mapping for that IP address if
fea681da
MK
1243it is known.
1244.TP
1245.I /proc/net/dev
c13182ef
MK
1246The dev pseudo-file contains network device status information.
1247This gives
1248the number of received and sent packets, the number of errors and
fea681da 1249collisions
c13182ef
MK
1250and other basic statistics.
1251These are used by the
fea681da 1252.BR ifconfig (8)
c13182ef
MK
1253program to report device status.
1254The format is:
fea681da
MK
1255
1256.nf
1257.ft CW
1258.in 1n
1259Inter-| Receive | Transmit
1260 face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
1261 lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0
1262 eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0
1263 ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0
1264 tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0
1265.in
1266.ft
1267.fi
1268.\" .TP
1269.\" .I /proc/net/ipx
1270.\" No information.
1271.\" .TP
1272.\" .I /proc/net/ipx_route
1273.\" No information.
1274.TP
1275.I /proc/net/dev_mcast
1276Defined in
1277.IR /usr/src/linux/net/core/dev_mcast.c :
1278.nf
1279.in +5
9fdfa163 1280indx interface_name dmi_u dmi_g dmi_address
fea681da
MK
12812 eth0 1 0 01005e000001
12823 eth1 1 0 01005e000001
12834 eth2 1 0 01005e000001
1284.in
1285.fi
1286.TP
1287.I /proc/net/igmp
c13182ef
MK
1288Internet Group Management Protocol.
1289Defined in
fea681da
MK
1290.IR /usr/src/linux/net/core/igmp.c .
1291.TP
1292.I /proc/net/rarp
1293This file uses the same format as the
1294.I arp
1295file and contains the current reverse mapping database used to provide
1296.BR rarp (8)
c13182ef
MK
1297reverse address lookup services.
1298If RARP is not configured into the
fea681da
MK
1299kernel,
1300this file will not be present.
1301.TP
1302.I /proc/net/raw
c13182ef
MK
1303Holds a dump of the RAW socket table.
1304Much of the information is not of
fea681da 1305use
c13182ef 1306apart from debugging.
6c04f928 1307The "sl" value is the kernel hash slot for the
fea681da 1308socket,
6c04f928
MK
1309the "local_address" is the local address and protocol number pair.
1310\&"St" is
c13182ef
MK
1311the internal status of the socket.
1312The "tx_queue" and "rx_queue" are the
fea681da 1313outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 1314The "tr", "tm\->when", and "rexmits" fields are not used by RAW.
fdc196f5
MK
1315The "uid"
1316field holds the effective UID of the creator of the socket.
fea681da
MK
1317.\" .TP
1318.\" .I /proc/net/route
1319.\" No information, but looks similar to
1320.\" .BR route (8).
1321.TP
1322.I /proc/net/snmp
c13182ef 1323This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP
fea681da 1324management
763f0e47 1325information bases for an SNMP agent.
fea681da
MK
1326.TP
1327.I /proc/net/tcp
c13182ef
MK
1328Holds a dump of the TCP socket table.
1329Much of the information is not
1330of use apart from debugging.
1331The "sl" value is the kernel hash slot
6beb1671
MK
1332for the socket, the "local_address" is the local address and port number pair.
1333The "rem_address" is the remote address and port number pair
6c04f928
MK
1334(if connected).
1335\&"St" is the internal status of the socket.
1336The "tx_queue" and "rx_queue" are the
fea681da 1337outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 1338The "tr", "tm\->when", and "rexmits" fields hold internal information of
fdc196f5
MK
1339the kernel socket state and are only useful for debugging.
1340The "uid"
1341field holds the effective UID of the creator of the socket.
fea681da
MK
1342.TP
1343.I /proc/net/udp
c13182ef
MK
1344Holds a dump of the UDP socket table.
1345Much of the information is not of
1346use apart from debugging.
1347The "sl" value is the kernel hash slot for the
6beb1671
MK
1348socket, the "local_address" is the local address and port number pair.
1349The "rem_address" is the remote address and port number pair
fea681da
MK
1350(if connected). "St" is the internal status of the socket.
1351The "tx_queue" and "rx_queue" are the outgoing and incoming data queue
c13182ef 1352in terms of kernel memory usage.
94e9d9fe 1353The "tr", "tm\->when", and "rexmits" fields
c13182ef 1354are not used by UDP.
fdc196f5
MK
1355The "uid"
1356field holds the effective UID of the creator of the socket.
fea681da
MK
1357The format is:
1358
1359.nf
1360.ft CW
1361.in 1n
94e9d9fe 1362sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid
fea681da
MK
1363 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0
1364 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0
1365 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0
1366.in
1367.ft
1368.fi
1369.TP
1370.I /proc/net/unix
1371Lists the UNIX domain sockets present within the system and their
c13182ef
MK
1372status.
1373The format is:
fea681da
MK
1374.nf
1375.sp .5
1376.ft CW
1377Num RefCount Protocol Flags Type St Path
1378 0: 00000002 00000000 00000000 0001 03
1379 1: 00000001 00000000 00010000 0001 01 /dev/printer
1380.ft
1381.sp .5
1382.fi
1383
6c04f928
MK
1384Here "Num" is the kernel table slot number, "RefCount" is the number
1385of users of the socket, "Protocol" is currently always 0, "Flags"
fea681da 1386represent the internal kernel flags holding the status of the
c13182ef 1387socket.
6c04f928
MK
1388Currently, type is always "1" (Unix domain datagram sockets are
1389not yet supported in the kernel).
1390\&"St" is the internal state of the
fea681da
MK
1391socket and Path is the bound path (if any) of the socket.
1392.TP
1393.I /proc/partitions
1394Contains major and minor numbers of each partition as well as number
1395of blocks and partition name.
1396.TP
1397.I /proc/pci
1398This is a listing of all PCI devices found during kernel initialization
1399and their configuration.
2990d781
MK
1400
1401This file has been deprecated in favor of a new /proc
1402interface for PCI
1403.RI ( /proc/bus/pci ).
1404It became optional in Linux 2.2 (available with
1405.B CONFIG_PCI_OLD_PROC
1406set at kernel compilation).
1407It became once more non-optionally enabled in Linux 2.4.
1408Next, it was deprecated in Linux 2.6 (still available with
1409.B CONFIG_PCI_LEGACY_PROC
1410set), and finally removed altogether since Linux 2.6.17.
b4e9ee8f
MK
1411.\" FIXME /proc/sched_debug
1412.\" .TP
1413.\" .IR /proc/sched_debug " (since Linux 2.6.23)"
1414.\" See also /proc/PID/sched
fea681da
MK
1415.TP
1416.I /proc/scsi
2990d781
MK
1417A directory with the scsi mid-level pseudo-file and various SCSI low-level
1418driver directories,
1419which contain a file for each SCSI host in this system, all of
c13182ef
MK
1420which give the status of some part of the SCSI IO subsystem.
1421These files contain ASCII structures and are, therefore, readable with
2990d781 1422.BR cat (1).
fea681da 1423
c13182ef 1424You can also write to some of the files to reconfigure the subsystem or
fea681da
MK
1425switch
1426certain features on or off.
1427.TP
1428.I /proc/scsi/scsi
c13182ef
MK
1429This is a listing of all SCSI devices known to the kernel.
1430The listing is
fea681da 1431similar to the one seen during bootup.
c13182ef 1432scsi currently supports only the \fIadd-single-device\fP command which
fea681da
MK
1433allows
1434root to add a hotplugged device to the list of known devices.
1435
c13182ef 1436An
6c04f928 1437.B echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi
c13182ef
MK
1438will cause
1439host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0.
1440If there
fea681da
MK
1441is already a device known on this address or the address is invalid, an
1442error will be returned.
1443.TP
1444.I /proc/scsi/[drivername]
c13182ef
MK
1445\fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740,
1446aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic,
1447scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000.
1448These directories show up for all drivers that registered at least one
1449SCSI
1450HBA.
1451Every directory contains one file per registered host.
1452Every
fea681da 1453host-file is named after the number the host was assigned during
c13182ef 1454initialization.
fea681da 1455
c13182ef 1456Reading these files will usually show driver and host configuration,
fea681da
MK
1457statistics etc.
1458
1459Writing to these files allows different things on different hosts.
1460For example, with the \fIlatency\fP and \fInolatency\fP commands,
1461root can switch on and off command latency measurement code in the
c13182ef
MK
1462eata_dma driver.
1463With the \fIlockup\fP and \fIunlock\fP commands,
1464root can control bus lockups simulated by the scsi_debug driver.
fea681da
MK
1465.TP
1466.I /proc/self
24d01c53 1467This directory refers to the process accessing the /proc file system,
fea681da
MK
1468and is identical to the /proc directory named by the process ID of the
1469same process.
1470.TP
1471.I /proc/slabinfo
c13182ef 1472Information about kernel caches.
821643a8
MK
1473Since Linux 2.6.16 this file is only present if the
1474.B CONFIG_SLAB
1475kernel configuration option is enabled.
350038ff 1476The columns in
38f76cd2 1477.I /proc/slabinfo
350038ff 1478are:
a08ea57c 1479.in +4n
fea681da 1480.nf
a08ea57c 1481
fea681da
MK
1482cache-name
1483num-active-objs
1484total-objs
1485object-size
1486num-active-slabs
1487total-slabs
1488num-pages-per-slab
1489.fi
a08ea57c
MK
1490.in
1491
c13182ef 1492See
fea681da
MK
1493.BR slabinfo (5)
1494for details.
1495.TP
1496.I /proc/stat
c13182ef
MK
1497kernel/system statistics.
1498Varies with architecture.
1499Common
fea681da
MK
1500entries include:
1501.RS
1502.TP
1503\fIcpu 3357 0 4313 1362393\fP
bfbfcd18 1504The amount of time, measured in units of
b877b392 1505USER_HZ (1/100ths of a second on most architectures),
b81087ab 1506.\" 1024 on Alpha and ia64
bfbfcd18
MK
1507that the system spent in user mode,
1508user mode with low priority (nice), system mode, and the
1509idle task, respectively.
b09b8526 1510.\" FIXME Actually, the following info about the /proc/stat 'cpu' field
777f5a9e 1511.\" does not seem to be quite right (at least in 2.6.12)
bfbfcd18 1512The last value should be USER_HZ times the
fea681da 1513second entry in the uptime pseudo-file.
ca92ce95 1514
bfbfcd18
MK
1515In Linux 2.6 this line includes three additional columns:
1516.I iowait
1517\- time waiting for I/O to complete (since 2.5.41);
1518.I irq
1519\- time servicing interrupts (since 2.6.0-test4);
1520.I softirq
1521\- time servicing softirqs (since 2.6.0-test4).
ca92ce95 1522
9de1f6cc
MK
1523Since Linux 2.6.11, there is an eighth column,
1524.I steal
1525\- stolen time, which is the time spent in other operating systems when
1526running in a virtualized environment
14c06953
MK
1527
1528Since Linux 2.6.24, there is a ninth column,
1529.IR guest ,
1530which is the time spent running a virtual CPU for guest
afef1764 1531operating systems under the control of the Linux kernel.
14c06953 1532.\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de
fea681da
MK
1533.TP
1534\fIpage 5741 1808\fP
1535The number of pages the system paged in and the number that were paged
1536out (from disk).
1537.TP
1538\fIswap 1 0\fP
1539The number of swap pages that have been brought in and out.
1540.TP
c13182ef 1541.\" FIXME The following is not the full picture for the 'intr' of
777f5a9e 1542.\" /proc/stat on 2.6:
fea681da 1543\fIintr 1462898\fP
bfbfcd18
MK
1544This line shows counts of interrupts serviced since boot time,
1545for each of the possible system interrupts.
1546The first column is the total of all interrupts serviced;
1547each subsequent column is the total for a particular interrupt.
fea681da
MK
1548.TP
1549\fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP...
1550(major,minor):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written)
bfbfcd18
MK
1551.br
1552(Linux 2.4 only)
fea681da
MK
1553.TP
1554\fIctxt 115315\fP
1555The number of context switches that the system underwent.
1556.TP
1557\fIbtime 769041601\fP
be9634cf 1558boot time, in seconds since the Epoch (January 1, 1970).
fea681da
MK
1559.TP
1560\fIprocesses 86031\fP
1561Number of forks since boot.
bfbfcd18
MK
1562.TP
1563\fIprocs_running 6\fP
1564Number of processes in runnable state.
1565(Linux 2.5.45 onwards.)
1566.TP
1567\fIprocs_blocked 2\fP
1568Number of processes blocked waiting for I/O to complete.
1569(Linux 2.5.45 onwards.)
fea681da
MK
1570.RE
1571.TP
1572.I /proc/swaps
c13182ef
MK
1573Swap areas in use.
1574See also
fea681da
MK
1575.BR swapon (8).
1576.TP
1577.I /proc/sys
1578This directory (present since 1.3.57) contains a number of files
1579and subdirectories corresponding to kernel variables.
1580These variables can be read and sometimes modified using
1581the \fIproc\fP file system, and the
1582.BR sysctl (2)
c13182ef
MK
1583system call.
1584Presently, there are subdirectories
fea681da
MK
1585.IR abi ", " debug ", " dev ", " fs ", " kernel ", " net ", " proc ", "
1586.IR rxrpc ", " sunrpc " and " vm
1587that each contain more files and subdirectories.
1588.TP
6ab7c0aa 1589.IR /proc/sys/abi " (since Linux 2.4.10)"
fea681da 1590This directory may contain files with application binary information.
6ab7c0aa
MK
1591.\" On some systems, it is not present.
1592See the kernel source file
1593.I Documentation/sysctl/abi.txt
1594for more information.
fea681da
MK
1595.TP
1596.I /proc/sys/debug
1597This directory may be empty.
1598.TP
1599.I /proc/sys/dev
e2badfdf 1600This directory contains device-specific information (e.g.,
9a67332e 1601.IR dev/cdrom/info ).
fea681da
MK
1602On
1603some systems, it may be empty.
1604.TP
1605.I /proc/sys/fs
6d64ca9c 1606This contains the subdirectories
b877b392 1607.IR binfmt_misc ", " inotify ", and " mqueue ,
fea681da 1608and files
c13182ef
MK
1609.IR dentry-state ", " dir-notify-enable ", " dquot-nr ", " file-max ", "
1610.IR file-nr ", " inode-max ", " inode-nr ", " inode-state ", "
1611.IR lease-break-time ", " leases-enable ", "
43da96f2
MK
1612.IR overflowgid ", " overflowuid ", "
1613.IR suid_dumpable ", "
1614.IR super-max ", and " super-nr .
fea681da
MK
1615.TP
1616.I /proc/sys/fs/binfmt_misc
c13182ef 1617Documentation for files in this directory can be found
b877b392 1618in the kernel sources in
fea681da
MK
1619.IR Documentation/binfmt_misc.txt .
1620.TP
1621.I /proc/sys/fs/dentry-state
c13182ef
MK
1622This file contains six numbers,
1623.IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), "
fea681da
MK
1624want_pages
1625(pages requested by system) and two dummy values.
1626nr_dentry seems to be 0 all the time.
1627nr_unused seems to be the number of unused dentries.
1628age_limit is the age in seconds after which dcache entries
1629can be reclaimed when memory is short and want_pages is
eba72288 1630non-zero when the kernel has called shrink_dcache_pages() and the
fea681da
MK
1631dcache isn't pruned yet.
1632.TP
1633.I /proc/sys/fs/dir-notify-enable
1634This file can be used to disable or enable the
1635.I dnotify
1636interface described in
1637.BR fcntl (2)
1638on a system-wide basis.
1639A value of 0 in this file disables the interface,
1640and a value of 1 enables it.
1641.TP
1642.I /proc/sys/fs/dquot-max
1643This file shows the maximum number of cached disk quota entries.
1644On some (2.4) systems, it is not present.
1645If the number of free cached disk quota entries is very low and
1646you have some awesome number of simultaneous system users,
1647you might want to raise the limit.
1648.TP
1649.I /proc/sys/fs/dquot-nr
1650This file shows the number of allocated disk quota
1651entries and the number of free disk quota entries.
1652.TP
1653.I /proc/sys/fs/file-max
1654This file defines
1655a system-wide limit on the number of open files for all processes.
1656(See also
1657.BR setrlimit (2),
1658which can be used by a process to set the per-process limit,
1659.BR RLIMIT_NOFILE ,
1660on the number of files it may open.)
1661If you get lots
1662of error messages about running out of file handles,
1663try increasing this value:
1664.br
1665
1666.br
1667.nf
1668.ft CW
1669echo 100000 > /proc/sys/fs/file-max
1670.fi
1671.ft
1672
1673The kernel constant
7b2b5ea4 1674.B NR_OPEN
fea681da
MK
1675imposes an upper limit on the value that may be placed in
1676.IR file-max .
1677
c13182ef 1678If you increase
fea681da
MK
1679.IR /proc/sys/fs/file-max ","
1680be sure to increase
1681.I /proc/sys/fs/inode-max
1682to 3-4 times the new
c13182ef 1683value of
fea681da
MK
1684.IR /proc/sys/fs/file-max ","
1685or you will run out of inodes.
1686.TP
1687.I /proc/sys/fs/file-nr
1688This (read-only) file
1689gives the number of files presently opened.
1690It contains three numbers: The number of allocated
1691file handles, the number of free file handles and the maximum
c13182ef
MK
1692number of file handles.
1693The kernel allocates file handles dynamically, but it
1694doesn't free them again.
1695If the number of allocated files is close to the
fea681da
MK
1696
1697maximum, you should consider increasing the maximum.
1698When the number of free file handles is
1699large, you've encountered a peak in your usage of file
1700handles and you probably don't need to increase the maximum.
1701.TP
c13182ef 1702.I /proc/sys/fs/inode-max
fea681da
MK
1703This file contains the maximum number of in-memory inodes.
1704On some (2.4) systems, it may not be
c13182ef
MK
1705present.
1706This value should be 3-4 times larger
9bef72b5
MK
1707than the value in file-max, since \fIstdin\fP, \fIstdout\fP
1708and network sockets also
c13182ef
MK
1709need an inode to handle them.
1710When you regularly run
fea681da
MK
1711out of inodes, you need to increase this value.
1712.TP
1713.I /proc/sys/fs/inode-nr
1714This file contains the first two values from inode-state.
1715.TP
1716.I /proc/sys/fs/inode-state
1717This file
c13182ef
MK
1718contains seven numbers: nr_inodes, nr_free_inodes, preshrink and four
1719dummy values.
1720nr_inodes is the number of inodes the system has allocated.
1721This can be slightly more than inode-max because
e02756a4 1722Linux allocates them one page full at a time.
fea681da 1723nr_free_inodes represents the number of free inodes.
eba72288 1724preshrink is non-zero when the nr_inodes > inode-max and the
fea681da
MK
1725system needs to prune the inode list instead of allocating
1726more.
1727.TP
b877b392 1728.IR /proc/sys/fs/inotify " (since Linux 2.6.13)"
c13182ef 1729This directory contains files
b877b392
MK
1730.IR max_queued_events ", " max_user_instances ", and " max_user_watches ,
1731that can be used to limit the amount of kernel memory consumed by the
1732.I inotify
1733interface.
c13182ef 1734For further details, see
435b27cc 1735.BR inotify (7).
b877b392 1736.TP
fea681da
MK
1737.I /proc/sys/fs/lease-break-time
1738This file
1739specifies the grace period that the kernel grants to a process
1740holding a file lease
1741.RB ( fcntl (2))
1742after it has sent a signal to that process notifying it
1743that another process is waiting to open the file.
1744If the lease holder does not remove or downgrade the lease within
1745this grace period, the kernel forcibly breaks the lease.
1746.TP
1747.I /proc/sys/fs/leases-enable
1748This file can be used to enable or disable file leases
1749.RB ( fcntl (2))
1750on a system-wide basis.
1751If this file contains the value 0, leases are disabled.
eba72288 1752A non-zero value enables leases.
6d64ca9c
MK
1753.TP
1754.IR /proc/sys/fs/mqueue " (since Linux 2.6.6)"
c13182ef 1755This directory contains files
6d64ca9c
MK
1756.IR msg_max ", " msgsize_max ", and " queues_max ,
1757controlling the resources used by POSIX message queues.
96018ebe 1758See
c13182ef 1759.BR mq_overview (7)
96018ebe 1760for details.
6d64ca9c
MK
1761.TP
1762.IR /proc/sys/fs/overflowgid " and " /proc/sys/fs/overflowuid
1763These files
1764allow you to change the value of the fixed UID and GID.
1765The default is 65534.
24d01c53 1766Some file systems only support 16-bit UIDs and GIDs, although in Linux
c13182ef 1767UIDs and GIDs are 32 bits.
24d01c53 1768When one of these file systems is mounted
6d64ca9c
MK
1769with writes enabled, any UID or GID that would exceed 65535 is translated
1770to the overflow value before being written to disk.
1771.TP
43da96f2
MK
1772.IR /proc/sys/fs/suid_dumpable " (since Linux 2.6.13)"
1773.\" The following is based on text from Documentation/sysctl/kernel.txt
c13182ef 1774The value in this file determines whether core dump files are
f1162930
MK
1775produced for set-user-ID or otherwise protected/tainted binaries.
1776Three different integer values can be specified:
43da96f2
MK
1777.sp
1778\fI0\ (default)\fP
d9bfdb9c 1779This provides the traditional (pre-Linux 2.6.13) behavior.
c13182ef 1780A core dump will not be produced for a process which has
f1162930 1781changed credentials (by calling
c13182ef
MK
1782.BR seteuid (2),
1783.BR setgid (2),
1784or similar, or by executing a set-user-ID or set-group-ID program)
f1162930 1785or whose binary does not have read permission enabled.
43da96f2 1786.sp
f1162930 1787\fI1\ ("debug")\fP
43da96f2 1788All processes dump core when possible.
c13182ef 1789The core dump is owned by the file system user ID of the dumping process
f1162930 1790and no security is applied.
43da96f2
MK
1791This is intended for system debugging situations only.
1792Ptrace is unchecked.
1793.sp
f1162930 1794\fI2\ ("suidsafe")\fP
c13182ef
MK
1795Any binary which normally would not be dumped (see "0" above)
1796is dumped readable by root only.
f1162930 1797This allows the user to remove the core dump file but not to read it.
c13182ef 1798For security reasons core dumps in this mode will not overwrite one
43da96f2 1799another or other files.
b877b392 1800This mode is appropriate when administrators are
43da96f2 1801attempting to debug problems in a normal environment.
fea681da 1802.TP
c13182ef
MK
1803.I /proc/sys/fs/super-max
1804This file
fea681da 1805controls the maximum number of superblocks, and
24d01c53 1806thus the maximum number of mounted file systems the kernel
c13182ef
MK
1807can have.
1808You only need to increase super-max if you need to
24d01c53 1809mount more file systems than the current value in super-max
fea681da
MK
1810allows you to.
1811.TP
1812.I /proc/sys/fs/super-nr
c13182ef 1813This file
24d01c53 1814contains the number of file systems currently mounted.
fea681da
MK
1815.TP
1816.I /proc/sys/kernel
1817This directory contains files
1818.IR acct ", " cad_pid ", " cap-bound ", "
1819.IR core_pattern ", " core_uses_pid ", "
1820.IR ctrl-alt-del ", " dentry-state ", " domainname ", "
c13182ef 1821.IR hotplug ", " hostname ", "
fea681da
MK
1822.IR htab-reclaim " (PowerPC only), "
1823.IR java-appletviewer " (binfmt_java, obsolete), "
1824.IR java-interpreter " (binfmt_java, obsolete), " l2cr " (PowerPC only), "
c13182ef 1825.IR modprobe ", " msgmax ", " msgmnb ", "
fea681da
MK
1826.IR msgmni ", " osrelease ", " ostype ", " overflowgid ", " overflowuid ,
1827.IR panic ", " panic_on_oops ", " pid_max ", "
1828.IR powersave-nap " (PowerPC only), " printk ", " pty ", " random ", "
c13182ef 1829.IR real-root-dev ", " reboot-cmd " (SPARC only), " rtsig-max ", "
fea681da
MK
1830.IR rtsig-nr ", " sem ", " sg-big-buff ", "
1831.IR shmall ", " shmmax ", " shmmni ", " sysrq ", " tainted ", " threads-max ,
43da96f2 1832.IR version ", and " zero-paged " (PowerPC only)."
fea681da
MK
1833.TP
1834.I /proc/sys/kernel/acct
c13182ef 1835This file
fea681da
MK
1836contains three numbers: highwater, lowwater and frequency.
1837If BSD-style process accounting is enabled these values control
d9bfdb9c 1838its behavior.
24d01c53 1839If free space on file system where the log lives
c13182ef
MK
1840goes below lowwater percent accounting suspends.
1841If free space gets
1842above highwater percent accounting resumes.
1843Frequency determines
fea681da 1844how often the kernel checks the amount of free space (value is in
c13182ef
MK
1845seconds).
1846Default values are 4, 2 and 30.
fea681da
MK
1847That is, suspend accounting if <= 2% of space is free; resume it
1848if >= 4% of space is free; consider information about amount of free space
1849valid for 30 seconds.
1850.TP
1851.I /proc/sys/kernel/cap-bound
1852This file holds the value of the kernel
0daa9e92 1853.I "capability bounding set"
fea681da
MK
1854(expressed as a signed decimal number).
1855This set is ANDed against the capabilities permitted to a process
c13182ef 1856during
ee6e96c1 1857.BR execve (2).
fea681da
MK
1858.TP
1859.I /proc/sys/kernel/core_pattern
5937fccd
MK
1860See
1861.BR core (5).
654cc098 1862.TP
fea681da 1863.I /proc/sys/kernel/core_uses_pid
5937fccd
MK
1864See
1865.BR core (5).
fea681da
MK
1866.TP
1867.I /proc/sys/kernel/ctrl-alt-del
1868This file
1869controls the handling of Ctrl-Alt-Del from the keyboard.
1870When the value in this file is 0, Ctrl-Alt-Del is trapped and
1871sent to the
49ec013c 1872.BR init (8)
fea681da
MK
1873program to handle a graceful restart.
1874When the value is > 0, Linux's reaction to a Vulcan
1875Nerve Pinch (tm) will be an immediate reboot, without even
1876syncing its dirty buffers.
6c04f928 1877Note: when a program (like dosemu) has the keyboard in "raw"
fea681da
MK
1878mode, the ctrl-alt-del is intercepted by the program before it
1879ever reaches the kernel tty layer, and it's up to the program
1880to decide what to do with it.
1881.TP
1882.I /proc/sys/kernel/hotplug
1883This file
1884contains the path for the hotplug policy agent.
60849763 1885The default value in this file is
9a67332e 1886.IR /sbin/hotplug .
fea681da
MK
1887.TP
1888.IR /proc/sys/kernel/domainname " and " /proc/sys/kernel/hostname
1889can be used to set the NIS/YP domainname and the
1890hostname of your box in exactly the same way as the commands
8b49407f
MK
1891.BR domainname (1)
1892and
03d2434e
MK
1893.BR hostname (1),
1894that is:
fea681da 1895
a08ea57c
MK
1896.in +4n
1897.nf
fea681da 1898# echo "darkstar" > /proc/sys/kernel/hostname
fea681da 1899# echo "mydomain" > /proc/sys/kernel/domainname
a08ea57c
MK
1900.fi
1901.in
fea681da 1902
fea681da 1903has the same effect as
fea681da 1904
a08ea57c
MK
1905.in +4n
1906.nf
fea681da 1907# hostname "darkstar"
fea681da 1908# domainname "mydomain"
a08ea57c
MK
1909.fi
1910.in
fea681da 1911
fea681da
MK
1912Note, however, that the classic darkstar.frop.org has the
1913hostname "darkstar" and DNS (Internet Domain Name Server)
1914domainname "frop.org", not to be confused with the NIS (Network
c13182ef
MK
1915Information Service) or YP (Yellow Pages) domainname.
1916These two
1917domain names are in general different.
1918For a detailed discussion
fea681da
MK
1919see the
1920.BR hostname (1)
1921man page.
1922.TP
1923.I /proc/sys/kernel/htab-reclaim
eba72288 1924(PowerPC only) If this file is set to a non-zero value,
fea681da 1925the PowerPC htab
9a67332e
MK
1926(see kernel file
1927.IR Documentation/powerpc/ppc_htab.txt )
1928is pruned
fea681da
MK
1929each time the system hits the idle loop.
1930.TP
1931.I /proc/sys/kernel/l2cr
1932(PowerPC only) This file
1933contains a flag that controls the L2 cache of G3 processor
c13182ef
MK
1934boards.
1935If 0, the cache is disabled.
eba72288 1936Enabled if non-zero.
fea681da
MK
1937.TP
1938.I /proc/sys/kernel/modprobe
6ab7c0aa
MK
1939This file contains the path for the kernel module loader.
1940The default value is
1941.IR /sbin/modprobe .
1942The file is only present if the kernel is built with the
821643a8
MK
1943.B CONFIG_KMOD
1944option enabled.
6ab7c0aa
MK
1945It is described by the kernel source file
1946.I Documentation/kmod.txt
1947(only present in kernel 2.4 and earlier).
fea681da
MK
1948.TP
1949.I /proc/sys/kernel/msgmax
1950This file defines
1951a system-wide limit specifying the maximum number of bytes in
1952a single message written on a System V message queue.
1953.TP
1954.I /proc/sys/kernel/msgmni
1955This file defines the system-wide limit on the number of
1956message queue identifiers.
1957(This file is only present in Linux 2.4 onwards.)
1958.TP
1959.I /proc/sys/kernel/msgmnb
d9bfdb9c 1960This file defines a system-wide parameter used to initialize the
fea681da 1961.I msg_qbytes
568105c6 1962setting for subsequently created message queues.
fea681da
MK
1963The
1964.I msg_qbytes
1965setting specifies the maximum number of bytes that may be written to the
1966message queue.
1967.TP
1968.IR /proc/sys/kernel/ostype " and " /proc/sys/kernel/osrelease
1969These files
1970give substrings of
1971.IR /proc/version .
1972.TP
1973.IR /proc/sys/kernel/overflowgid " and " /proc/sys/kernel/overflowuid
1974These files duplicate the files
1975.I /proc/sys/fs/overflowgid
1976and
1977.IR /proc/sys/fs/overflowuid .
1978.TP
1979.I /proc/sys/kernel/panic
1980gives read/write access to the kernel variable
1981.IR panic_timeout .
eba72288 1982If this is zero, the kernel will loop on a panic; if non-zero
fea681da 1983it indicates that the kernel should autoreboot after this number
c13182ef
MK
1984of seconds.
1985When you use the
fea681da
MK
1986software watchdog device driver, the recommended setting is 60.
1987.TP
1988.I /proc/sys/kernel/panic_on_oops
d9bfdb9c 1989This file (new in Linux 2.5) controls the kernel's behavior when an oops
c13182ef
MK
1990or BUG is encountered.
1991If this file contains 0, then the system
1992tries to continue operation.
1993If it contains 1, then the system
fea681da 1994delays a few seconds (to give klogd time to record the oops output)
c13182ef 1995and then panics.
fea681da
MK
1996If the
1997.I /proc/sys/kernel/panic
eba72288 1998file is also non-zero then the machine will be rebooted.
fea681da
MK
1999.TP
2000.I /proc/sys/kernel/pid_max
c13182ef 2001This file
fea681da
MK
2002(new in Linux 2.5)
2003specifies the value at which PIDs wrap around
2004(i.e., the value in this file is one greater than the maximum PID).
2005The default value for this file, 32768,
2006results in the same range of PIDs as on earlier kernels.
c13182ef 2007On 32-bit platforms, 32768 is the maximum value for
b3b8bd24 2008.IR pid_max .
c13182ef 2009On 64-bit systems,
b3b8bd24
MK
2010.I pid_max
2011can be set to any value up to 2^22
b1b0eb73
MK
2012.RB ( PID_MAX_LIMIT ,
2013approximately 4 million).
c13182ef 2014.\" Prior to 2.6.10, pid_max could also be raised above 32768 on 32-bit
b3b8bd24
MK
2015.\" platforms, but this broke /proc/PID
2016.\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=109513010926152&w=2
fea681da
MK
2017.TP
2018.IR /proc/sys/kernel/powersave-nap " (PowerPC only)"
c13182ef 2019This file contains a flag.
6c04f928 2020If set, Linux-PPC will use the "nap" mode of
fea681da 2021powersaving,
6c04f928 2022otherwise the "doze" mode will be used.
fea681da
MK
2023.TP
2024.I /proc/sys/kernel/printk
2025The four values in this file
2026are console_loglevel, default_message_loglevel, minimum_console_level and
2027default_console_loglevel.
2028These values influence printk() behavior when printing or
c13182ef
MK
2029logging error messages.
2030See
fea681da
MK
2031.BR syslog (2)
2032for more info on the different loglevels.
2033Messages with a higher priority than
2034console_loglevel will be printed to the console.
2035Messages without an explicit priority
2036will be printed with priority default_message_level.
2037minimum_console_loglevel is the minimum (highest) value to which
2038console_loglevel can be set.
2039default_console_loglevel is the default value for console_loglevel.
2040.TP
2041.IR /proc/sys/kernel/pty " (since Linux 2.6.4)"
c13182ef 2042This directory
fea681da
MK
2043contains two files relating to the number of Unix 98
2044pseudo-terminals (see
2045.BR pts (4))
2046on the system.
2047.TP
2048.I /proc/sys/kernel/pty/max
2049This file defines the maximum number of pseudo-terminals.
2050.TP
2051.I /proc/sys/kernel/pty/nr
2052This read-only file
2053indicates how many pseudo-terminals are currently in use.
2054.TP
fea681da
MK
2055.I /proc/sys/kernel/random
2056This directory
2057contains various parameters controlling the operation of the file
2058.IR /dev/random .
c13182ef 2059See
95a32af8
MK
2060.BR random (4)
2061for further information.
fea681da
MK
2062.TP
2063.I /proc/sys/kernel/real-root-dev
2064This file
9a67332e
MK
2065is documented in the kernel source file
2066.IR Documentation/initrd.txt .
fea681da
MK
2067.TP
2068.IR /proc/sys/kernel/reboot-cmd " (Sparc only) "
2069This file seems to be a way to give an argument to the SPARC
c13182ef
MK
2070ROM/Flash boot loader.
2071Maybe to tell it what to do after
fea681da
MK
2072rebooting?
2073.TP
2074.I /proc/sys/kernel/rtsig-max
c13182ef 2075(Only in kernels up to and including 2.6.7; see
70556c17 2076.BR setrlimit (2))
fea681da 2077This file can be used to tune the maximum number
6f36deb4 2078of POSIX real-time (queued) signals that can be outstanding
fea681da
MK
2079in the system.
2080.TP
2081.I /proc/sys/kernel/rtsig-nr
70556c17 2082(Only in kernels up to and including 2.6.7.)
6f36deb4 2083This file shows the number POSIX real-time signals currently queued.
fea681da
MK
2084.TP
2085.IR /proc/sys/kernel/sem " (since Linux 2.4)"
2086This file contains 4 numbers defining limits for System V IPC semaphores.
c13182ef 2087These fields are, in order:
fea681da
MK
2088.RS
2089.IP SEMMSL 8
2090The maximum semaphores per semaphore set.
2091.IP SEMMNS 8
2092A system-wide limit on the number of semaphores in all semaphore sets.
2093.IP SEMOPM 8
2094The maximum number of operations that may be specified in a
2095.BR semop (2)
2096call.
2097.IP SEMMNI 8
2098A system-wide limit on the maximum number of semaphore identifiers.
2099.RE
2100.TP
2101.I /proc/sys/kernel/sg-big-buff
c13182ef 2102This file
fea681da 2103shows the size of the generic SCSI device (sg) buffer.
5ec8d26f 2104You can't tune it just yet, but you could change it at
9a67332e
MK
2105compile time by editing
2106.I include/scsi/sg.h
2107and changing
b1b0eb73
MK
2108the value of
2109.BR SG_BIG_BUFF .
c13182ef 2110However, there shouldn't be any reason to change this value.
fea681da
MK
2111.TP
2112.I /proc/sys/kernel/shmall
2113This file
2114contains the system-wide limit on the total number of pages of
2115System V shared memory.
2116.TP
2117.I /proc/sys/kernel/shmmax
2118This file
cf50118f 2119can be used to query and set the run-time limit
c13182ef 2120on the maximum (System V IPC) shared memory segment size that can be
fea681da 2121created.
b1b0eb73 2122Shared memory segments up to 1GB are now supported in the
c13182ef 2123kernel.
b1b0eb73
MK
2124This value defaults to
2125.BR SHMMAX .
fea681da
MK
2126.TP
2127.I /proc/sys/kernel/shmmni
2128(available in Linux 2.4 and onwards)
2129This file
2130specifies the system-wide maximum number of System V shared memory
2131segments that can be created.
2132.TP
2133.I /proc/sys/kernel/version
2134contains a string like:
fea681da 2135
3c1a1cdc 2136 #5 Wed Feb 25 21:49:24 MET 1998
fea681da 2137
6c04f928 2138The "#5" means that
fea681da
MK
2139this is the fifth kernel built from this source base and the
2140date behind it indicates the time the kernel was built.
2141.TP
2142.IR /proc/sys/kernel/zero-paged " (PowerPC only) "
2143This file
c13182ef 2144contains a flag.
eba72288 2145When enabled (non-zero), Linux-PPC will pre-zero pages in
fea681da
MK
2146the idle loop, possibly speeding up get_free_pages.
2147.TP
2148.I /proc/sys/net
2149This directory contains networking stuff.
81c6dd6c
MK
2150Explanations for some of the files under this directory can be found in
2151.BR tcp (7)
2152and
2153.BR ip (7).
fea681da 2154.TP
ec650cc1
MK
2155.I /proc/sys/net/core/somaxconn
2156This file defines a ceiling value for the
2157.I backlog
2158argument of
2159.BR listen (2);
2160see the
2161.BR listen (2)
2162manual page for details.
2163.TP
fea681da
MK
2164.I /proc/sys/proc
2165This directory may be empty.
2166.TP
2167.I /proc/sys/sunrpc
2168This directory supports Sun remote procedure call for network file system
c13182ef
MK
2169(NFS).
2170On some systems, it is not present.
fea681da
MK
2171.TP
2172.I /proc/sys/vm
c13182ef 2173This directory contains files for memory management tuning, buffer and
fea681da
MK
2174cache
2175management.
2176.TP
b6c40587
MK
2177.IR /proc/sys/vm/drop_caches " (since Linux 2.6.16)"
2178Writing to this file causes the kernel to drop clean caches, dentries and
2179inodes from memory, causing that memory to become free.
2180
c13182ef 2181To free pagecache, use
b6c40587
MK
2182.IR "echo 1 > /proc/sys/vm/drop_caches" ;
2183to free dentries and inodes, use
2184.IR "echo 2 > /proc/sys/vm/drop_caches" ;
2185to free pagecache, dentries and inodes, use
2186.IR "echo 3 > /proc/sys/vm/drop_caches" .
2187
c13182ef 2188Because this is a non-destructive operation and dirty objects
b6c40587 2189are not freeable, the
c13182ef 2190user should run
b6c40587
MK
2191.BR sync (8)
2192first.
2193.TP
473ad28f
MK
2194.IR /proc/sys/vm/legacy_va_layout " (since Linux 2.6.9)"
2195.\" The following is from Documentation/filesystems/proc.txt
eba72288 2196If non-zero, this disable the new 32-bit memory-mapping layout;
473ad28f
MK
2197the kernel will use the legacy (2.4) layout for all processes.
2198.TP
fea681da 2199.I /proc/sys/vm/overcommit_memory
c13182ef
MK
2200This file contains the kernel virtual memory accounting mode.
2201Values are:
fea681da
MK
2202.br
22030: heuristic overcommit (this is the default)
2204.br
22051: always overcommit, never check
2206.br
22072: always check, never overcommit
2208.br
2209In mode 0, calls of
2210.BR mmap (2)
097585ed 2211with
0daa9e92 2212.B MAP_NORESERVE
097585ed 2213set are not checked, and the default check is very weak,
fea681da 2214leading to the risk of getting a process "OOM-killed".
eba72288 2215Under Linux 2.4 any non-zero value implies mode 1.
fea681da
MK
2216In mode 2 (available since Linux 2.6), the total virtual address space
2217on the system is limited to (SS + RAM*(r/100)),
2218where SS is the size of the swap space, and RAM
2219is the size of the physical memory, and r is the contents of the file
2220.IR /proc/sys/vm/overcommit_ratio .
2221.TP
2222.I /proc/sys/vm/overcommit_ratio
c13182ef 2223See the description of
fea681da
MK
2224.IR /proc/sys/vm/overcommit_memory .
2225.TP
2226.I /proc/sysvipc
c13182ef 2227Subdirectory containing the pseudo-files
fea681da 2228.IR msg ", " sem " and " shm "."
c13182ef 2229These files list the System V Interprocess Communication (IPC) objects
fea681da
MK
2230(respectively: message queues, semaphores, and shared memory)
2231that currently exist on the system,
2232providing similar information to that available via
2233.BR ipcs (1).
2234These files have headers and are formatted (one IPC object per line)
2235for easy understanding.
2c5e151c 2236.BR svipc (7)
fea681da
MK
2237provides further background on the information shown by these files.
2238.TP
2239.I /proc/tty
c13182ef 2240Subdirectory containing the pseudo-files and subdirectories for
fea681da
MK
2241tty drivers and line disciplines.
2242.TP
2243.I /proc/uptime
2244This file contains two numbers: the uptime of the system (seconds),
2245and the amount of time spent in idle process (seconds).
2246.TP
2247.I /proc/version
2248This string identifies the kernel version that is currently running.
030d3025
MK
2249It includes the contents of
2250.IR /proc/sys/kernel/ostype ,
0daa9e92 2251.I /proc/sys/kernel/osrelease
030d3025
MK
2252and
2253.IR /proc/sys/kernel/version .
c13182ef 2254For example:
fea681da
MK
2255.nf
2256.in -2
2257.ft CW
2258Linux version 1.0.9 (quinlan@phaze) #1 Sat May 14 01:51:54 EDT 1994
2259.ft
2260.in +2
2261.fi
b4e9ee8f
MK
2262.\" FIXME Document /proc/timer_list
2263.\" .TP
2264.\" .IR /proc/timer_list " (since Linux 2.6.21)"
2265.\" See the 2.6.21 Change log
2266.\" FIXME Document /proc/timer_stats
2267.\" .TP
2268.\" .IR /proc/timer_stats " (since Linux 2.6.21)"
2269.\" See the 2.6.21 Change log
fea681da
MK
2270.TP
2271.IR /proc/vmstat " (since Linux 2.6)"
2272This file displays various virtual memory statistics.
363f747c
MK
2273.TP
2274.IR /proc/zoneinfo " (since Linux 2.6.13)"
2275This file display information about memory zones.
d9bfdb9c 2276This is useful for analyzing virtual memory behavior.
218e46f8 2277.\" FIXME more should be said about /proc/zoneinfo
e37e3282
MK
2278.SH NOTES
2279Many strings (i.e., the environment and command line) are in
f81fb444 2280the internal format, with sub-fields terminated by null bytes (\(aq\\0\(aq),
e37e3282
MK
2281so you
2282may find that things are more readable if you use \fIod \-c\fP or \fItr
2283"\\000" "\\n"\fP to read them.
26868e5b 2284Alternatively, \fIecho \`cat <file>\`\fP works well.
e37e3282
MK
2285
2286This manual page is incomplete, possibly inaccurate, and is the kind
2287of thing that needs to be updated very often.
2288.\" .SH ACKNOWLEDGEMENTS
2289.\" The material on /proc/sys/fs and /proc/sys/kernel is closely based on
2290.\" kernel source documentation files written by Rik van Riel.
fea681da
MK
2291.SH "SEE ALSO"
2292.BR cat (1),
2293.BR find (1),
2294.BR free (1),
fea681da
MK
2295.BR ps (1),
2296.BR tr (1),
2297.BR uptime (1),
2298.BR chroot (2),
2299.BR mmap (2),
2300.BR readlink (2),
2301.BR syslog (2),
2302.BR slabinfo (5),
2303.BR hier (7),
2304.BR arp (8),
2305.BR dmesg (8),
2306.BR hdparm (8),
2307.BR ifconfig (8),
2308.BR init (8),
2309.BR lsmod (8),
2310.BR lspci (8),
809d0164 2311.BR mount (8),
fea681da
MK
2312.BR netstat (8),
2313.BR procinfo (8),
2314.BR route (8)
2315.br
2316.I /usr/src/linux/Documentation/filesystems/proc.txt