]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man5/proc.5
Note that HRTs are not supported on all h/w.
[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.
c8e9f4f1 633This includes guest time (time spent running a virtual CPU, see below).
fea681da
MK
634.TP
635\fIstime\fP %lu
636The number of jiffies that this process has been scheduled in kernel
637mode.
638.TP
639\fIcutime\fP %ld
640The number of jiffies that this process's
c13182ef
MK
641waited-for children have been scheduled in user mode.
642(See also
fea681da 643.BR times (2).)
c8e9f4f1 644This includes guest time (time spent running a virtual CPU, see below).
fea681da
MK
645.TP
646\fIcstime\fP %ld
647The number of jiffies that this process's
648waited-for children have been scheduled in kernel mode.
649.TP
650\fIpriority\fP %ld
c13182ef
MK
651The standard nice value, plus fifteen.
652The value is never negative in the kernel.
fea681da
MK
653.TP
654\fInice\fP %ld
8729177b 655The nice value ranges from 19 (nicest) to \-19 (not nice to others).
fea681da
MK
656.TP
657.\" .TP
658.\" \fIcounter\fP %ld
659.\" The current maximum size in jiffies of the process's next timeslice,
660.\" or what is currently left of its current timeslice, if it is the
661.\" currently running process.
662.\" .TP
663.\" \fItimeout\fP %u
664.\" The time in jiffies of the process's next timeout.
0e94f77b
MK
665.\" timeout was removed sometime around 2.1/2.2
666\fInum_threads\fP %ld
2ebfeb1b 667Number of threads in this process (since Linux 2.6).
bb83d1b9 668Before kernel 2.6, this field was hard coded to 0 as a placeholder
0e94f77b 669for an earlier removed field.
fea681da
MK
670.TP
671\fIitrealvalue\fP %ld
8bd58774
MK
672The time in jiffies before the next
673.B SIGALRM
674is sent to the process due to an interval timer.
0e94f77b
MK
675Since kernel 2.6.17, this field is no longer maintained,
676and is hard coded as 0.
fea681da 677.TP
0e94f77b 678\fIstarttime\fP %llu (was %lu before Linux 2.6)
fea681da
MK
679The time in jiffies the process started after system boot.
680.TP
681\fIvsize\fP %lu
682Virtual memory size in bytes.
683.TP
684\fIrss\fP %ld
685Resident Set Size: number of pages the process has in real memory,
c13182ef
MK
686minus 3 for administrative purposes.
687This is just the pages which
688count towards text, data, or stack space.
689This does not include pages
fea681da
MK
690which have not been demand-loaded in, or which are swapped out.
691.TP
692\fIrlim\fP %lu
693Current limit in bytes on the rss of the process (usually
6944294967295 on i386).
695.TP
696\fIstartcode\fP %lu
697The address above which program text can run.
698.TP
699\fIendcode\fP %lu
700The address below which program text can run.
701.TP
702\fIstartstack\fP %lu
703The address of the start of the stack.
704.TP
705\fIkstkesp\fP %lu
706The current value of esp (stack pointer), as found in the
707kernel stack page for the process.
708.TP
709\fIkstkeip\fP %lu
710The current EIP (instruction pointer).
711.TP
712\fIsignal\fP %lu
0c6085e0 713The bitmap of pending signals.
fea681da
MK
714.TP
715\fIblocked\fP %lu
0c6085e0 716The bitmap of blocked signals.
fea681da
MK
717.TP
718\fIsigignore\fP %lu
719The bitmap of ignored signals.
720.TP
721\fIsigcatch\fP %lu
0c6085e0 722The bitmap of caught signals.
fea681da
MK
723.TP
724\fIwchan\fP %lu
c13182ef
MK
725This is the "channel" in which the process is waiting.
726It is the
fea681da 727address of a system call, and can be looked up in a namelist if you
c13182ef 728need a textual name.
9a67332e
MK
729(If you have an up-to-date
730.IR /etc/psdatabase ,
731then
4d9b6984 732try \fIps \-l\fP to see the WCHAN field in action.)
fea681da
MK
733.TP
734\fInswap\fP %lu
0e94f77b 735.\" nswap was added in 2.0
4d9b6984 736Number of pages swapped (not maintained).
fea681da
MK
737.TP
738\fIcnswap\fP %lu
0e94f77b 739.\" cnswap was added in 2.0
4d9b6984 740Cumulative \fInswap\fP for child processes (not maintained).
fea681da 741.TP
2ebfeb1b 742\fIexit_signal\fP %d (since Linux 2.1.22)
fea681da
MK
743Signal to be sent to parent when we die.
744.TP
2ebfeb1b 745\fIprocessor\fP %d (since Linux 2.2.8)
fea681da 746CPU number last executed on.
568105c6 747.TP
2ebfeb1b 748\fIrt_priority\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
568105c6
MK
749Real-time scheduling priority (see
750.BR sched_setscheduler (2)).
751.TP
2ebfeb1b 752\fIpolicy\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
568105c6
MK
753Scheduling policy (see
754.BR sched_setscheduler (2)).
167450d6 755.TP
2ebfeb1b 756\fIdelayacct_blkio_ticks\fP %llu (since Linux 2.6.18)
0e94f77b 757Aggregated block I/O delays, measured in clock ticks (centiseconds).
14c06953
MK
758.TP
759\fIguest_time\fP %lu (since Linux 2.6.24)
760Guest time of the process (time spent running a virtual CPU
761for a guest operating system), in centiseconds.
762.TP
763\fIcguest_time\fP %ld (since Linux 2.6.24)
764Guest time of the process's children, in centiseconds.
fea681da
MK
765.RE
766.TP
767.I /proc/[number]/statm
c13182ef
MK
768Provides information about memory status in pages.
769The columns are:
a08ea57c
MK
770.in +4n
771.nf
772
773size total program size
774resident resident set size
775share shared pages
776text text (code)
777lib library
778data data/stack
779dt dirty pages (unused in Linux 2.6)
780.fi
781.in
fea681da
MK
782.TP
783.I /proc/[number]/status
784Provides much of the information in
785.I /proc/[number]/stat
786and
787.I /proc/[number]/statm
788in a format that's easier for humans to parse.
16b5f7ba
MK
789Here's an example:
790.in +4n
791.nf
792
793$ cat /proc/$$/status
794Name: bash
795State: S (sleeping)
796Tgid: 3515
797Pid: 3515
798PPid: 3452
799TracerPid: 0
800Uid: 1000 1000 1000 1000
801Gid: 100 100 100 100
802FDSize: 256
803Groups: 16 33 100
804VmPeak: 9136 kB
805VmSize: 7896 kB
806VmLck: 0 kB
807VmHWM: 7572 kB
808VmRSS: 6316 kB
809VmData: 5224 kB
810VmStk: 88 kB
811VmExe: 572 kB
812VmLib: 1708 kB
813VmPTE: 20 kB
814Threads: 1
815SigQ: 0/3067
816SigPnd: 0000000000000000
817ShdPnd: 0000000000000000
818SigBlk: 0000000000010000
819SigIgn: 0000000000384004
820SigCgt: 000000004b813efb
821CapInh: 0000000000000000
822CapPrm: 0000000000000000
823CapEff: 0000000000000000
824CapBnd: ffffffffffffffff
825Cpus_allowed: 00000001
826Cpus_allowed_list: 0
827Mems_allowed: 1
828Mems_allowed_list: 0
829voluntary_ctxt_switches: 150
830nonvoluntary_ctxt_switches: 545
831.fi
832.in
833.IP
834The fields are as follows:
835.RS
836.IP * 2
837.IR Name :
838Command run by this process.
839.IP *
840.IR State :
841Current state of the process. One of
842"R (running)",
843"S (sleeping)",
844"D (disk sleep)",
845"T (stopped)",
846"T (tracing stop)",
847"Z (zombie)",
848or
849"X (dead)".
850.IP *
851.IR Tgid :
852Thread group ID (i.e., Process ID).
853.IP *
854.IR Pid :
855Thread ID (see
856.BR gettid (2)).
857.IP *
858.IR TracerPid :
859PID of process tracing this process (0 if not being traced).
860.IP *
861.IR Uid ", " Gid :
862Real, effective, saved set, and file system UIDs (GIDs).
863.IP *
864.IR FDSize :
865Number of file descriptor slots currently allocated.
866.IP *
867.IR Groups :
868Supplementary group list.
869.IP *
870.IR VmPeak :
871Peak virtual memory size.
872.IP *
873.IR VmSize :
874Virtual memory size.
875.IP *
876.IR VmLck :
877Locked memory size.
878.IP *
879.IR VmHWM :
880Peak resident set size ("high water mark").
881.IP *
882.IR VmRSS :
883Resident set size.
884.IP *
885.IR VmData ", " VmStk ", " VmExe :
886Size of data, stack, and text segments.
887.IP *
888.IR VmLib :
889Shared library code size.
890.IP *
891.IR VmPTE :
892Page table entries size (since Linux 2.6.10).
893.IP *
894.IR Threads :
895Number of threads in process containing this thread.
896.IP *
897.IR SigPnd ", " ShdPnd :
898Number of signals pending for thread and for process as a whole (see
899.BR pthreads (7)
900and
901.BR signal (7)).
902.IP *
903.IR SigBlk ", " SigIgn ", " SigCgt :
904Masks indicating signals being blocked, ignored, and caught (see
905.BR signal (7)).
906.IP *
907.IR CapInh ", " CapPrm ", " CapEff :
908Masks of capabilities enabled in inheritable, permitted, and effective sets
909(see
910.BR capabilities (7)).
911.IP *
912.IR CapBnd :
913Capability Bounding set
914(since kernel 2.6.26, see
915.BR capabilities (7)).
916.IP *
917.IR Cpus_allowed :
918Mask of CPUs on which this process may run
919(since Linux 2.6.24, see
920.BR cpuset (7)).
921.IP *
922.IR Cpus_allowed_list :
923Same as previous, but in "list format"
924(since Linux 2.6.26, see
925.BR cpuset (7)).
926.IP *
927.IR Mems_allowed :
928Mask of memory nodes allowed to this process
929(since Linux 2.6.24, see
930.BR cpuset (7)).
931.IP *
932.IR Mems_allowed_list :
933Same as previous, but in "list format"
934(since Linux 2.6.26, see
935.BR cpuset (7)).
936.IP *
937.IR voluntary_context_switches ", " nonvoluntary_context_switches :
938Number of voluntary and involuntary context switches (since Linux 2.6.23).
939.RE
fea681da 940.TP
2ebfeb1b 941.IR /proc/[number]/task " (since Linux 2.6.0-test6)"
afcaf646
MK
942This is a directory that contains one subdirectory
943for each thread in the process.
944The name of each subdirectory is the numerical thread ID of the
945thread (see
946.BR gettid (2)).
947Within each of these subdirectories, there is a set of
948files with the same names and contents as under the
949.I /proc/[number]
950directories.
951For attributes that are shared by all threads, the contents for
952each of the files under the
953.I task/[thread-ID]
954subdirectories will be the same as in the corresponding
c13182ef 955file in the parent
afcaf646
MK
956.I /proc/[number]
957directory
c13182ef 958(e.g., in a multithreaded process, all of the
afcaf646 959.I task/[thread-ID]/cwd
c13182ef 960files will have the same value as the
afcaf646 961.I /proc/[number]/cwd
c13182ef 962file in the parent directory, since all of the threads in a process
afcaf646
MK
963share a working directory).
964For attributes that are distinct for each thread,
c13182ef 965the corresponding files under
afcaf646
MK
966.I task/[thread-ID]
967may have different values (e.g., various fields in each of the
968.I task/[thread-ID]/status
969files may be different for each thread).
970
971.\" The following was still true as at kernel 2.6.13
972In a multithreaded process, the contents of the
973.I /proc/[number]/task
c13182ef 974directory are not available if the main thread has already terminated
afcaf646
MK
975(typically by calling
976.BR pthread_exit (3)).
977.TP
fea681da 978.I /proc/apm
097585ed
MK
979Advanced power management version and battery information when
980.B CONFIG_APM
981is defined at kernel compilation time.
fea681da
MK
982.TP
983.I /proc/bus
984Contains subdirectories for installed busses.
985.TP
986.I /proc/bus/pccard
097585ed
MK
987Subdirectory for pcmcia devices when
988.B CONFIG_PCMCIA
989is set at kernel compilation time.
fea681da
MK
990.TP
991.I /proc/bus/pccard/drivers
992.TP
993.I /proc/bus/pci
c13182ef
MK
994Contains various bus subdirectories and pseudo-files containing
995information about pci busses, installed devices, and device
996drivers.
997Some of these files are not ASCII.
fea681da
MK
998.TP
999.I /proc/bus/pci/devices
c13182ef
MK
1000Information about pci devices.
1001They may be accessed through
fea681da
MK
1002.BR lspci (8)
1003and
1004.BR setpci (8).
1005.TP
1006.I /proc/cmdline
c13182ef
MK
1007Arguments passed to the Linux kernel at boot time.
1008Often done via a boot manager such as
fea681da 1009.BR lilo (1).
2bb6d7e6 1010.\" FIXME Document /proc/config.gz (new in kernel 2.6)
fea681da
MK
1011.TP
1012.I /proc/cpuinfo
1013This is a collection of CPU and system architecture dependent items,
1014for each supported architecture a different list.
1015Two common entries are \fIprocessor\fP which gives CPU number and
c13182ef
MK
1016\fIbogomips\fP; a system constant that is calculated
1017during kernel initialization.
1018SMP machines have information for
fea681da
MK
1019each CPU.
1020.TP
1021.I /proc/devices
c13182ef
MK
1022Text listing of major numbers and device groups.
1023This can be used by MAKEDEV scripts for consistency with the kernel.
fea681da
MK
1024.TP
1025.IR /proc/diskstats " (since Linux 2.5.69)"
1026This file contains disk I/O statistics for each disk device.
1027See the kernel source file
1028.I Documentation/iostats.txt
1029for further information.
1030.TP
1031.I /proc/dma
c13182ef 1032This is a list of the registered \fIISA\fP DMA (direct memory access)
fea681da
MK
1033channels in use.
1034.TP
1035.I /proc/driver
1036Empty subdirectory.
1037.TP
1038.I /proc/execdomains
1039List of the execution domains (ABI personalities).
1040.TP
1041.I /proc/fb
097585ed
MK
1042Frame buffer information when
1043.B CONFIG_FB
1044is defined during kernel compilation.
fea681da
MK
1045.TP
1046.I /proc/filesystems
24d01c53
MK
1047A text listing of the file systems which are supported by the kernel,
1048namely file systems which were compiled into the kernel or whose kernel
809d0164 1049modules are currently loaded. (See also
fb477da2 1050.BR filesystems (5).)
24d01c53 1051If a file system is marked with "nodev",
809d0164 1052this means that it does not require a block device to be mounted
24d01c53 1053(e.g., virtual file system, network file system).
809d0164
MK
1054
1055Incidentally, this file may be used by
1056.BR mount (8)
24d01c53
MK
1057when no file system is specified and it didn't manage to determine the
1058file system type.
1059Then file systems contained in this file are tried
809d0164 1060(excepted those that are marked with "nodev").
fea681da
MK
1061.TP
1062.I /proc/fs
1063Empty subdirectory.
1064.TP
1065.I /proc/ide
1066This directory
c13182ef
MK
1067exists on systems with the ide bus.
1068There are directories for each ide channel and attached device.
1069Files include:
fea681da 1070
a08ea57c 1071.in +4n
fea681da
MK
1072.nf
1073cache buffer size in KB
1074capacity number of sectors
1075driver driver version
1076geometry physical and logical geometry
9fdfa163 1077identify in hexadecimal
fea681da
MK
1078media media type
1079model manufacturer's model number
1080settings drive settings
9fdfa163
MK
1081smart_thresholds in hexadecimal
1082smart_values in hexadecimal
fea681da 1083.fi
a08ea57c 1084.in
fea681da 1085
c13182ef 1086The
fea681da
MK
1087.BR hdparm (8)
1088utility provides access to this information in a friendly format.
1089.TP
1090.I /proc/interrupts
1091This is used to record the number of interrupts per each IRQ on (at
c13182ef
MK
1092least) the i386 architecture.
1093Very easy to read formatting, done in
fea681da
MK
1094ASCII.
1095.TP
1096.I /proc/iomem
1097I/O memory map in Linux 2.4.
1098.TP
1099.I /proc/ioports
c13182ef 1100This is a list of currently registered Input-Output port regions that
fea681da
MK
1101are in use.
1102.TP
1103.IR /proc/kallsyms " (since Linux 2.5.71)"
1104This holds the kernel exported symbol definitions used by the
1105.BR modules (X)
1106tools to dynamically link and bind loadable modules.
1107In Linux 2.5.47 and earlier, a similar file with slightly different syntax
1108was named
1109.IR ksyms .
1110.TP
1111.I /proc/kcore
1112This file represents the physical memory of the system and is stored
c13182ef
MK
1113in the ELF core file format.
1114With this pseudo-file, and an unstripped
9a67332e
MK
1115kernel
1116.RI ( /usr/src/linux/vmlinux )
1117binary, GDB can be used to
fea681da
MK
1118examine the current state of any kernel data structures.
1119
1120The total length of the file is the size of physical memory (RAM) plus
11214KB.
1122.TP
1123.I /proc/kmsg
1124This file can be used instead of the
1125.BR syslog (2)
c13182ef
MK
1126system call to read kernel messages.
1127A process must have superuser
fea681da 1128privileges to read this file, and only one process should read this
c13182ef
MK
1129file.
1130This file should not be read if a syslog process is running
fea681da
MK
1131which uses the
1132.BR syslog (2)
1133system call facility to log kernel messages.
1134
1135Information in this file is retrieved with the
1136.BR dmesg (8)
1137program.
1138.TP
1139.IR /proc/ksyms " (Linux 1.1.23-2.5.47)"
1140See
1141.IR /proc/kallsyms .
1142.TP
1143.I /proc/loadavg
6b05dc38
MK
1144The first three fields in this file are load average figures
1145giving the number of jobs in the run queue (state R)
fea681da
MK
1146or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes.
1147They are the same as the load average numbers given by
1148.BR uptime (1)
1149and other programs.
6b05dc38
MK
1150The fourth field consists of two numbers separated by a slash (/).
1151The first of these is the number of currently executing kernel
c13182ef 1152scheduling entities (processes, threads);
6b05dc38
MK
1153this will be less than or equal to the number of CPUs.
1154The value after the slash is the number of kernel scheduling entities
1155that currently exist on the system.
1156The fifth field is the PID of the process that was most
1157recently created on the system.
fea681da
MK
1158.TP
1159.I /proc/locks
1160This file shows current file locks
1161.RB ( flock "(2) and " fcntl (2))
1162and leases
1163.RB ( fcntl (2)).
1164.TP
89dd5f8a 1165.IR /proc/malloc " (only up to and including Linux 2.2)"
097585ed 1166This file is only present if
89dd5f8a 1167.B CONFIG_DEBUG_MALLOC
097585ed 1168was defined during compilation.
fea681da
MK
1169.TP
1170.I /proc/meminfo
1171This is used by
1172.BR free (1)
1173to report the amount of free and used memory (both physical and swap)
1174on the system as well as the shared memory and buffers used by the
1175kernel.
1176
1177It is in the same format as
1178.BR free (1),
1179except in bytes rather than KB.
1180.TP
1181.I /proc/mounts
1182This is a list of all the file systems currently mounted on the system.
1183The format of this file is documented in
31e9a9ec 1184.BR fstab (5).
c13182ef 1185Since kernel version 2.6.15, this file is pollable:
57651c15
MK
1186after opening the file for reading, a change in this file
1187(i.e., a file system mount or unmount) causes
1188.BR select (2)
1189to mark the file descriptor as readable, and
1190.BR poll (2)
1191and
1192.BR epoll_wait (2)
1193mark the file as having an error condition.
fea681da
MK
1194.TP
1195.I /proc/modules
1196A text list of the modules that have been loaded by the system.
1197See also
1198.BR lsmod (8).
1199.TP
1200.I /proc/mtrr
c13182ef
MK
1201Memory Type Range Registers.
1202See
fea681da
MK
1203.I /usr/src/linux/Documentation/mtrr.txt
1204for details.
1205.TP
1206.I /proc/net
1207various net pseudo-files, all of which give the status of some part of
c13182ef
MK
1208the networking layer.
1209These files contain ASCII structures and are,
1210therefore, readable with cat.
1211However, the standard
fea681da
MK
1212.BR netstat (8)
1213suite provides much cleaner access to these files.
1214.TP
1215.I /proc/net/arp
1216This holds an ASCII readable dump of the kernel ARP table used for
c13182ef
MK
1217address resolutions.
1218It will show both dynamically learned and
1219pre-programmed ARP entries.
1220The format is:
fea681da
MK
1221
1222.nf
1223.ft CW
1224.in 8n
1225IP address HW type Flags HW address Mask Device
1226192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0
1227192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0
1228.ft
1229.fi
1230.in
1231
6c04f928 1232Here "IP address" is the IPv4 address of the machine and the "HW type"
c13182ef
MK
1233is the hardware type of the address from RFC\ 826.
1234The flags are the internal
9a67332e
MK
1235flags of the ARP structure (as defined in
1236.IR /usr/include/linux/if_arp.h )
1237and
6c04f928 1238the "HW address" is the data link layer mapping for that IP address if
fea681da
MK
1239it is known.
1240.TP
1241.I /proc/net/dev
c13182ef
MK
1242The dev pseudo-file contains network device status information.
1243This gives
1244the number of received and sent packets, the number of errors and
fea681da 1245collisions
c13182ef
MK
1246and other basic statistics.
1247These are used by the
fea681da 1248.BR ifconfig (8)
c13182ef
MK
1249program to report device status.
1250The format is:
fea681da
MK
1251
1252.nf
1253.ft CW
1254.in 1n
1255Inter-| Receive | Transmit
1256 face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
1257 lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0
1258 eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0
1259 ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0
1260 tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0
1261.in
1262.ft
1263.fi
1264.\" .TP
1265.\" .I /proc/net/ipx
1266.\" No information.
1267.\" .TP
1268.\" .I /proc/net/ipx_route
1269.\" No information.
1270.TP
1271.I /proc/net/dev_mcast
1272Defined in
1273.IR /usr/src/linux/net/core/dev_mcast.c :
1274.nf
1275.in +5
9fdfa163 1276indx interface_name dmi_u dmi_g dmi_address
fea681da
MK
12772 eth0 1 0 01005e000001
12783 eth1 1 0 01005e000001
12794 eth2 1 0 01005e000001
1280.in
1281.fi
1282.TP
1283.I /proc/net/igmp
c13182ef
MK
1284Internet Group Management Protocol.
1285Defined in
fea681da
MK
1286.IR /usr/src/linux/net/core/igmp.c .
1287.TP
1288.I /proc/net/rarp
1289This file uses the same format as the
1290.I arp
1291file and contains the current reverse mapping database used to provide
1292.BR rarp (8)
c13182ef
MK
1293reverse address lookup services.
1294If RARP is not configured into the
fea681da
MK
1295kernel,
1296this file will not be present.
1297.TP
1298.I /proc/net/raw
c13182ef
MK
1299Holds a dump of the RAW socket table.
1300Much of the information is not of
fea681da 1301use
c13182ef 1302apart from debugging.
6c04f928 1303The "sl" value is the kernel hash slot for the
fea681da 1304socket,
6c04f928
MK
1305the "local_address" is the local address and protocol number pair.
1306\&"St" is
c13182ef
MK
1307the internal status of the socket.
1308The "tx_queue" and "rx_queue" are the
fea681da 1309outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 1310The "tr", "tm\->when", and "rexmits" fields are not used by RAW.
fdc196f5
MK
1311The "uid"
1312field holds the effective UID of the creator of the socket.
fea681da
MK
1313.\" .TP
1314.\" .I /proc/net/route
1315.\" No information, but looks similar to
1316.\" .BR route (8).
1317.TP
1318.I /proc/net/snmp
c13182ef 1319This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP
fea681da 1320management
763f0e47 1321information bases for an SNMP agent.
fea681da
MK
1322.TP
1323.I /proc/net/tcp
c13182ef
MK
1324Holds a dump of the TCP socket table.
1325Much of the information is not
1326of use apart from debugging.
1327The "sl" value is the kernel hash slot
6beb1671
MK
1328for the socket, the "local_address" is the local address and port number pair.
1329The "rem_address" is the remote address and port number pair
6c04f928
MK
1330(if connected).
1331\&"St" is the internal status of the socket.
1332The "tx_queue" and "rx_queue" are the
fea681da 1333outgoing and incoming data queue in terms of kernel memory usage.
94e9d9fe 1334The "tr", "tm\->when", and "rexmits" fields hold internal information of
fdc196f5
MK
1335the kernel socket state and are only useful for debugging.
1336The "uid"
1337field holds the effective UID of the creator of the socket.
fea681da
MK
1338.TP
1339.I /proc/net/udp
c13182ef
MK
1340Holds a dump of the UDP socket table.
1341Much of the information is not of
1342use apart from debugging.
1343The "sl" value is the kernel hash slot for the
6beb1671
MK
1344socket, the "local_address" is the local address and port number pair.
1345The "rem_address" is the remote address and port number pair
fea681da
MK
1346(if connected). "St" is the internal status of the socket.
1347The "tx_queue" and "rx_queue" are the outgoing and incoming data queue
c13182ef 1348in terms of kernel memory usage.
94e9d9fe 1349The "tr", "tm\->when", and "rexmits" fields
c13182ef 1350are not used by UDP.
fdc196f5
MK
1351The "uid"
1352field holds the effective UID of the creator of the socket.
fea681da
MK
1353The format is:
1354
1355.nf
1356.ft CW
1357.in 1n
94e9d9fe 1358sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid
fea681da
MK
1359 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0
1360 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0
1361 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0
1362.in
1363.ft
1364.fi
1365.TP
1366.I /proc/net/unix
1367Lists the UNIX domain sockets present within the system and their
c13182ef
MK
1368status.
1369The format is:
fea681da
MK
1370.nf
1371.sp .5
1372.ft CW
1373Num RefCount Protocol Flags Type St Path
1374 0: 00000002 00000000 00000000 0001 03
1375 1: 00000001 00000000 00010000 0001 01 /dev/printer
1376.ft
1377.sp .5
1378.fi
1379
6c04f928
MK
1380Here "Num" is the kernel table slot number, "RefCount" is the number
1381of users of the socket, "Protocol" is currently always 0, "Flags"
fea681da 1382represent the internal kernel flags holding the status of the
c13182ef 1383socket.
6c04f928
MK
1384Currently, type is always "1" (Unix domain datagram sockets are
1385not yet supported in the kernel).
1386\&"St" is the internal state of the
fea681da
MK
1387socket and Path is the bound path (if any) of the socket.
1388.TP
1389.I /proc/partitions
1390Contains major and minor numbers of each partition as well as number
1391of blocks and partition name.
1392.TP
1393.I /proc/pci
1394This is a listing of all PCI devices found during kernel initialization
1395and their configuration.
2990d781
MK
1396
1397This file has been deprecated in favor of a new /proc
1398interface for PCI
1399.RI ( /proc/bus/pci ).
1400It became optional in Linux 2.2 (available with
1401.B CONFIG_PCI_OLD_PROC
1402set at kernel compilation).
1403It became once more non-optionally enabled in Linux 2.4.
1404Next, it was deprecated in Linux 2.6 (still available with
1405.B CONFIG_PCI_LEGACY_PROC
1406set), and finally removed altogether since Linux 2.6.17.
b4e9ee8f
MK
1407.\" FIXME /proc/sched_debug
1408.\" .TP
1409.\" .IR /proc/sched_debug " (since Linux 2.6.23)"
1410.\" See also /proc/PID/sched
fea681da
MK
1411.TP
1412.I /proc/scsi
2990d781
MK
1413A directory with the scsi mid-level pseudo-file and various SCSI low-level
1414driver directories,
1415which contain a file for each SCSI host in this system, all of
c13182ef
MK
1416which give the status of some part of the SCSI IO subsystem.
1417These files contain ASCII structures and are, therefore, readable with
2990d781 1418.BR cat (1).
fea681da 1419
c13182ef 1420You can also write to some of the files to reconfigure the subsystem or
fea681da
MK
1421switch
1422certain features on or off.
1423.TP
1424.I /proc/scsi/scsi
c13182ef
MK
1425This is a listing of all SCSI devices known to the kernel.
1426The listing is
fea681da 1427similar to the one seen during bootup.
c13182ef 1428scsi currently supports only the \fIadd-single-device\fP command which
fea681da
MK
1429allows
1430root to add a hotplugged device to the list of known devices.
1431
c13182ef 1432An
6c04f928 1433.B echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi
c13182ef
MK
1434will cause
1435host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0.
1436If there
fea681da
MK
1437is already a device known on this address or the address is invalid, an
1438error will be returned.
1439.TP
1440.I /proc/scsi/[drivername]
c13182ef
MK
1441\fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740,
1442aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic,
1443scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000.
1444These directories show up for all drivers that registered at least one
1445SCSI
1446HBA.
1447Every directory contains one file per registered host.
1448Every
fea681da 1449host-file is named after the number the host was assigned during
c13182ef 1450initialization.
fea681da 1451
c13182ef 1452Reading these files will usually show driver and host configuration,
fea681da
MK
1453statistics etc.
1454
1455Writing to these files allows different things on different hosts.
1456For example, with the \fIlatency\fP and \fInolatency\fP commands,
1457root can switch on and off command latency measurement code in the
c13182ef
MK
1458eata_dma driver.
1459With the \fIlockup\fP and \fIunlock\fP commands,
1460root can control bus lockups simulated by the scsi_debug driver.
fea681da
MK
1461.TP
1462.I /proc/self
24d01c53 1463This directory refers to the process accessing the /proc file system,
fea681da
MK
1464and is identical to the /proc directory named by the process ID of the
1465same process.
1466.TP
1467.I /proc/slabinfo
c13182ef 1468Information about kernel caches.
821643a8
MK
1469Since Linux 2.6.16 this file is only present if the
1470.B CONFIG_SLAB
1471kernel configuration option is enabled.
350038ff 1472The columns in
38f76cd2 1473.I /proc/slabinfo
350038ff 1474are:
a08ea57c 1475.in +4n
fea681da 1476.nf
a08ea57c 1477
fea681da
MK
1478cache-name
1479num-active-objs
1480total-objs
1481object-size
1482num-active-slabs
1483total-slabs
1484num-pages-per-slab
1485.fi
a08ea57c
MK
1486.in
1487
c13182ef 1488See
fea681da
MK
1489.BR slabinfo (5)
1490for details.
1491.TP
1492.I /proc/stat
c13182ef
MK
1493kernel/system statistics.
1494Varies with architecture.
1495Common
fea681da
MK
1496entries include:
1497.RS
1498.TP
1499\fIcpu 3357 0 4313 1362393\fP
bfbfcd18 1500The amount of time, measured in units of
b877b392 1501USER_HZ (1/100ths of a second on most architectures),
b81087ab 1502.\" 1024 on Alpha and ia64
bfbfcd18
MK
1503that the system spent in user mode,
1504user mode with low priority (nice), system mode, and the
1505idle task, respectively.
b09b8526 1506.\" FIXME Actually, the following info about the /proc/stat 'cpu' field
777f5a9e 1507.\" does not seem to be quite right (at least in 2.6.12)
bfbfcd18 1508The last value should be USER_HZ times the
fea681da 1509second entry in the uptime pseudo-file.
ca92ce95 1510
bfbfcd18
MK
1511In Linux 2.6 this line includes three additional columns:
1512.I iowait
1513\- time waiting for I/O to complete (since 2.5.41);
1514.I irq
1515\- time servicing interrupts (since 2.6.0-test4);
1516.I softirq
1517\- time servicing softirqs (since 2.6.0-test4).
ca92ce95 1518
9de1f6cc
MK
1519Since Linux 2.6.11, there is an eighth column,
1520.I steal
1521\- stolen time, which is the time spent in other operating systems when
1522running in a virtualized environment
14c06953
MK
1523
1524Since Linux 2.6.24, there is a ninth column,
1525.IR guest ,
1526which is the time spent running a virtual CPU for guest
afef1764 1527operating systems under the control of the Linux kernel.
14c06953 1528.\" See Changelog entry for 5e84cfde51cf303d368fcb48f22059f37b3872de
fea681da
MK
1529.TP
1530\fIpage 5741 1808\fP
1531The number of pages the system paged in and the number that were paged
1532out (from disk).
1533.TP
1534\fIswap 1 0\fP
1535The number of swap pages that have been brought in and out.
1536.TP
c13182ef 1537.\" FIXME The following is not the full picture for the 'intr' of
777f5a9e 1538.\" /proc/stat on 2.6:
fea681da 1539\fIintr 1462898\fP
bfbfcd18
MK
1540This line shows counts of interrupts serviced since boot time,
1541for each of the possible system interrupts.
1542The first column is the total of all interrupts serviced;
1543each subsequent column is the total for a particular interrupt.
fea681da
MK
1544.TP
1545\fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP...
1546(major,minor):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written)
bfbfcd18
MK
1547.br
1548(Linux 2.4 only)
fea681da
MK
1549.TP
1550\fIctxt 115315\fP
1551The number of context switches that the system underwent.
1552.TP
1553\fIbtime 769041601\fP
be9634cf 1554boot time, in seconds since the Epoch (January 1, 1970).
fea681da
MK
1555.TP
1556\fIprocesses 86031\fP
1557Number of forks since boot.
bfbfcd18
MK
1558.TP
1559\fIprocs_running 6\fP
1560Number of processes in runnable state.
1561(Linux 2.5.45 onwards.)
1562.TP
1563\fIprocs_blocked 2\fP
1564Number of processes blocked waiting for I/O to complete.
1565(Linux 2.5.45 onwards.)
fea681da
MK
1566.RE
1567.TP
1568.I /proc/swaps
c13182ef
MK
1569Swap areas in use.
1570See also
fea681da
MK
1571.BR swapon (8).
1572.TP
1573.I /proc/sys
1574This directory (present since 1.3.57) contains a number of files
1575and subdirectories corresponding to kernel variables.
1576These variables can be read and sometimes modified using
1577the \fIproc\fP file system, and the
1578.BR sysctl (2)
c13182ef
MK
1579system call.
1580Presently, there are subdirectories
fea681da
MK
1581.IR abi ", " debug ", " dev ", " fs ", " kernel ", " net ", " proc ", "
1582.IR rxrpc ", " sunrpc " and " vm
1583that each contain more files and subdirectories.
1584.TP
6ab7c0aa 1585.IR /proc/sys/abi " (since Linux 2.4.10)"
fea681da 1586This directory may contain files with application binary information.
6ab7c0aa
MK
1587.\" On some systems, it is not present.
1588See the kernel source file
1589.I Documentation/sysctl/abi.txt
1590for more information.
fea681da
MK
1591.TP
1592.I /proc/sys/debug
1593This directory may be empty.
1594.TP
1595.I /proc/sys/dev
e2badfdf 1596This directory contains device-specific information (e.g.,
9a67332e 1597.IR dev/cdrom/info ).
fea681da
MK
1598On
1599some systems, it may be empty.
1600.TP
1601.I /proc/sys/fs
6d64ca9c 1602This contains the subdirectories
b877b392 1603.IR binfmt_misc ", " inotify ", and " mqueue ,
fea681da 1604and files
c13182ef
MK
1605.IR dentry-state ", " dir-notify-enable ", " dquot-nr ", " file-max ", "
1606.IR file-nr ", " inode-max ", " inode-nr ", " inode-state ", "
1607.IR lease-break-time ", " leases-enable ", "
43da96f2
MK
1608.IR overflowgid ", " overflowuid ", "
1609.IR suid_dumpable ", "
1610.IR super-max ", and " super-nr .
fea681da
MK
1611.TP
1612.I /proc/sys/fs/binfmt_misc
c13182ef 1613Documentation for files in this directory can be found
b877b392 1614in the kernel sources in
fea681da
MK
1615.IR Documentation/binfmt_misc.txt .
1616.TP
1617.I /proc/sys/fs/dentry-state
c13182ef
MK
1618This file contains six numbers,
1619.IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), "
fea681da
MK
1620want_pages
1621(pages requested by system) and two dummy values.
1622nr_dentry seems to be 0 all the time.
1623nr_unused seems to be the number of unused dentries.
1624age_limit is the age in seconds after which dcache entries
1625can be reclaimed when memory is short and want_pages is
eba72288 1626non-zero when the kernel has called shrink_dcache_pages() and the
fea681da
MK
1627dcache isn't pruned yet.
1628.TP
1629.I /proc/sys/fs/dir-notify-enable
1630This file can be used to disable or enable the
1631.I dnotify
1632interface described in
1633.BR fcntl (2)
1634on a system-wide basis.
1635A value of 0 in this file disables the interface,
1636and a value of 1 enables it.
1637.TP
1638.I /proc/sys/fs/dquot-max
1639This file shows the maximum number of cached disk quota entries.
1640On some (2.4) systems, it is not present.
1641If the number of free cached disk quota entries is very low and
1642you have some awesome number of simultaneous system users,
1643you might want to raise the limit.
1644.TP
1645.I /proc/sys/fs/dquot-nr
1646This file shows the number of allocated disk quota
1647entries and the number of free disk quota entries.
1648.TP
1649.I /proc/sys/fs/file-max
1650This file defines
1651a system-wide limit on the number of open files for all processes.
1652(See also
1653.BR setrlimit (2),
1654which can be used by a process to set the per-process limit,
1655.BR RLIMIT_NOFILE ,
1656on the number of files it may open.)
1657If you get lots
1658of error messages about running out of file handles,
1659try increasing this value:
1660.br
1661
1662.br
1663.nf
1664.ft CW
1665echo 100000 > /proc/sys/fs/file-max
1666.fi
1667.ft
1668
1669The kernel constant
7b2b5ea4 1670.B NR_OPEN
fea681da
MK
1671imposes an upper limit on the value that may be placed in
1672.IR file-max .
1673
c13182ef 1674If you increase
fea681da
MK
1675.IR /proc/sys/fs/file-max ","
1676be sure to increase
1677.I /proc/sys/fs/inode-max
1678to 3-4 times the new
c13182ef 1679value of
fea681da
MK
1680.IR /proc/sys/fs/file-max ","
1681or you will run out of inodes.
1682.TP
1683.I /proc/sys/fs/file-nr
1684This (read-only) file
1685gives the number of files presently opened.
1686It contains three numbers: The number of allocated
1687file handles, the number of free file handles and the maximum
c13182ef
MK
1688number of file handles.
1689The kernel allocates file handles dynamically, but it
1690doesn't free them again.
1691If the number of allocated files is close to the
fea681da
MK
1692
1693maximum, you should consider increasing the maximum.
1694When the number of free file handles is
1695large, you've encountered a peak in your usage of file
1696handles and you probably don't need to increase the maximum.
1697.TP
c13182ef 1698.I /proc/sys/fs/inode-max
fea681da
MK
1699This file contains the maximum number of in-memory inodes.
1700On some (2.4) systems, it may not be
c13182ef
MK
1701present.
1702This value should be 3-4 times larger
9bef72b5
MK
1703than the value in file-max, since \fIstdin\fP, \fIstdout\fP
1704and network sockets also
c13182ef
MK
1705need an inode to handle them.
1706When you regularly run
fea681da
MK
1707out of inodes, you need to increase this value.
1708.TP
1709.I /proc/sys/fs/inode-nr
1710This file contains the first two values from inode-state.
1711.TP
1712.I /proc/sys/fs/inode-state
1713This file
c13182ef
MK
1714contains seven numbers: nr_inodes, nr_free_inodes, preshrink and four
1715dummy values.
1716nr_inodes is the number of inodes the system has allocated.
1717This can be slightly more than inode-max because
e02756a4 1718Linux allocates them one page full at a time.
fea681da 1719nr_free_inodes represents the number of free inodes.
eba72288 1720preshrink is non-zero when the nr_inodes > inode-max and the
fea681da
MK
1721system needs to prune the inode list instead of allocating
1722more.
1723.TP
b877b392 1724.IR /proc/sys/fs/inotify " (since Linux 2.6.13)"
c13182ef 1725This directory contains files
b877b392
MK
1726.IR max_queued_events ", " max_user_instances ", and " max_user_watches ,
1727that can be used to limit the amount of kernel memory consumed by the
1728.I inotify
1729interface.
c13182ef 1730For further details, see
435b27cc 1731.BR inotify (7).
b877b392 1732.TP
fea681da
MK
1733.I /proc/sys/fs/lease-break-time
1734This file
1735specifies the grace period that the kernel grants to a process
1736holding a file lease
1737.RB ( fcntl (2))
1738after it has sent a signal to that process notifying it
1739that another process is waiting to open the file.
1740If the lease holder does not remove or downgrade the lease within
1741this grace period, the kernel forcibly breaks the lease.
1742.TP
1743.I /proc/sys/fs/leases-enable
1744This file can be used to enable or disable file leases
1745.RB ( fcntl (2))
1746on a system-wide basis.
1747If this file contains the value 0, leases are disabled.
eba72288 1748A non-zero value enables leases.
6d64ca9c
MK
1749.TP
1750.IR /proc/sys/fs/mqueue " (since Linux 2.6.6)"
c13182ef 1751This directory contains files
6d64ca9c
MK
1752.IR msg_max ", " msgsize_max ", and " queues_max ,
1753controlling the resources used by POSIX message queues.
96018ebe 1754See
c13182ef 1755.BR mq_overview (7)
96018ebe 1756for details.
6d64ca9c
MK
1757.TP
1758.IR /proc/sys/fs/overflowgid " and " /proc/sys/fs/overflowuid
1759These files
1760allow you to change the value of the fixed UID and GID.
1761The default is 65534.
24d01c53 1762Some file systems only support 16-bit UIDs and GIDs, although in Linux
c13182ef 1763UIDs and GIDs are 32 bits.
24d01c53 1764When one of these file systems is mounted
6d64ca9c
MK
1765with writes enabled, any UID or GID that would exceed 65535 is translated
1766to the overflow value before being written to disk.
1767.TP
43da96f2
MK
1768.IR /proc/sys/fs/suid_dumpable " (since Linux 2.6.13)"
1769.\" The following is based on text from Documentation/sysctl/kernel.txt
c13182ef 1770The value in this file determines whether core dump files are
f1162930
MK
1771produced for set-user-ID or otherwise protected/tainted binaries.
1772Three different integer values can be specified:
43da96f2
MK
1773.sp
1774\fI0\ (default)\fP
d9bfdb9c 1775This provides the traditional (pre-Linux 2.6.13) behavior.
c13182ef 1776A core dump will not be produced for a process which has
f1162930 1777changed credentials (by calling
c13182ef
MK
1778.BR seteuid (2),
1779.BR setgid (2),
1780or similar, or by executing a set-user-ID or set-group-ID program)
f1162930 1781or whose binary does not have read permission enabled.
43da96f2 1782.sp
f1162930 1783\fI1\ ("debug")\fP
43da96f2 1784All processes dump core when possible.
c13182ef 1785The core dump is owned by the file system user ID of the dumping process
f1162930 1786and no security is applied.
43da96f2
MK
1787This is intended for system debugging situations only.
1788Ptrace is unchecked.
1789.sp
f1162930 1790\fI2\ ("suidsafe")\fP
c13182ef
MK
1791Any binary which normally would not be dumped (see "0" above)
1792is dumped readable by root only.
f1162930 1793This allows the user to remove the core dump file but not to read it.
c13182ef 1794For security reasons core dumps in this mode will not overwrite one
43da96f2 1795another or other files.
b877b392 1796This mode is appropriate when administrators are
43da96f2 1797attempting to debug problems in a normal environment.
fea681da 1798.TP
c13182ef
MK
1799.I /proc/sys/fs/super-max
1800This file
fea681da 1801controls the maximum number of superblocks, and
24d01c53 1802thus the maximum number of mounted file systems the kernel
c13182ef
MK
1803can have.
1804You only need to increase super-max if you need to
24d01c53 1805mount more file systems than the current value in super-max
fea681da
MK
1806allows you to.
1807.TP
1808.I /proc/sys/fs/super-nr
c13182ef 1809This file
24d01c53 1810contains the number of file systems currently mounted.
fea681da
MK
1811.TP
1812.I /proc/sys/kernel
1813This directory contains files
1814.IR acct ", " cad_pid ", " cap-bound ", "
1815.IR core_pattern ", " core_uses_pid ", "
1816.IR ctrl-alt-del ", " dentry-state ", " domainname ", "
c13182ef 1817.IR hotplug ", " hostname ", "
fea681da
MK
1818.IR htab-reclaim " (PowerPC only), "
1819.IR java-appletviewer " (binfmt_java, obsolete), "
1820.IR java-interpreter " (binfmt_java, obsolete), " l2cr " (PowerPC only), "
c13182ef 1821.IR modprobe ", " msgmax ", " msgmnb ", "
fea681da
MK
1822.IR msgmni ", " osrelease ", " ostype ", " overflowgid ", " overflowuid ,
1823.IR panic ", " panic_on_oops ", " pid_max ", "
1824.IR powersave-nap " (PowerPC only), " printk ", " pty ", " random ", "
c13182ef 1825.IR real-root-dev ", " reboot-cmd " (SPARC only), " rtsig-max ", "
fea681da
MK
1826.IR rtsig-nr ", " sem ", " sg-big-buff ", "
1827.IR shmall ", " shmmax ", " shmmni ", " sysrq ", " tainted ", " threads-max ,
43da96f2 1828.IR version ", and " zero-paged " (PowerPC only)."
fea681da
MK
1829.TP
1830.I /proc/sys/kernel/acct
c13182ef 1831This file
fea681da
MK
1832contains three numbers: highwater, lowwater and frequency.
1833If BSD-style process accounting is enabled these values control
d9bfdb9c 1834its behavior.
24d01c53 1835If free space on file system where the log lives
c13182ef
MK
1836goes below lowwater percent accounting suspends.
1837If free space gets
1838above highwater percent accounting resumes.
1839Frequency determines
fea681da 1840how often the kernel checks the amount of free space (value is in
c13182ef
MK
1841seconds).
1842Default values are 4, 2 and 30.
fea681da
MK
1843That is, suspend accounting if <= 2% of space is free; resume it
1844if >= 4% of space is free; consider information about amount of free space
1845valid for 30 seconds.
1846.TP
1847.I /proc/sys/kernel/cap-bound
1848This file holds the value of the kernel
0daa9e92 1849.I "capability bounding set"
fea681da
MK
1850(expressed as a signed decimal number).
1851This set is ANDed against the capabilities permitted to a process
c13182ef 1852during
ee6e96c1 1853.BR execve (2).
fea681da
MK
1854.TP
1855.I /proc/sys/kernel/core_pattern
5937fccd
MK
1856See
1857.BR core (5).
654cc098 1858.TP
fea681da 1859.I /proc/sys/kernel/core_uses_pid
5937fccd
MK
1860See
1861.BR core (5).
fea681da
MK
1862.TP
1863.I /proc/sys/kernel/ctrl-alt-del
1864This file
1865controls the handling of Ctrl-Alt-Del from the keyboard.
1866When the value in this file is 0, Ctrl-Alt-Del is trapped and
1867sent to the
49ec013c 1868.BR init (8)
fea681da
MK
1869program to handle a graceful restart.
1870When the value is > 0, Linux's reaction to a Vulcan
1871Nerve Pinch (tm) will be an immediate reboot, without even
1872syncing its dirty buffers.
6c04f928 1873Note: when a program (like dosemu) has the keyboard in "raw"
fea681da
MK
1874mode, the ctrl-alt-del is intercepted by the program before it
1875ever reaches the kernel tty layer, and it's up to the program
1876to decide what to do with it.
1877.TP
1878.I /proc/sys/kernel/hotplug
1879This file
1880contains the path for the hotplug policy agent.
60849763 1881The default value in this file is
9a67332e 1882.IR /sbin/hotplug .
fea681da
MK
1883.TP
1884.IR /proc/sys/kernel/domainname " and " /proc/sys/kernel/hostname
1885can be used to set the NIS/YP domainname and the
1886hostname of your box in exactly the same way as the commands
8b49407f
MK
1887.BR domainname (1)
1888and
03d2434e
MK
1889.BR hostname (1),
1890that is:
fea681da 1891
a08ea57c
MK
1892.in +4n
1893.nf
fea681da 1894# echo "darkstar" > /proc/sys/kernel/hostname
fea681da 1895# echo "mydomain" > /proc/sys/kernel/domainname
a08ea57c
MK
1896.fi
1897.in
fea681da 1898
fea681da 1899has the same effect as
fea681da 1900
a08ea57c
MK
1901.in +4n
1902.nf
fea681da 1903# hostname "darkstar"
fea681da 1904# domainname "mydomain"
a08ea57c
MK
1905.fi
1906.in
fea681da 1907
fea681da
MK
1908Note, however, that the classic darkstar.frop.org has the
1909hostname "darkstar" and DNS (Internet Domain Name Server)
1910domainname "frop.org", not to be confused with the NIS (Network
c13182ef
MK
1911Information Service) or YP (Yellow Pages) domainname.
1912These two
1913domain names are in general different.
1914For a detailed discussion
fea681da
MK
1915see the
1916.BR hostname (1)
1917man page.
1918.TP
1919.I /proc/sys/kernel/htab-reclaim
eba72288 1920(PowerPC only) If this file is set to a non-zero value,
fea681da 1921the PowerPC htab
9a67332e
MK
1922(see kernel file
1923.IR Documentation/powerpc/ppc_htab.txt )
1924is pruned
fea681da
MK
1925each time the system hits the idle loop.
1926.TP
1927.I /proc/sys/kernel/l2cr
1928(PowerPC only) This file
1929contains a flag that controls the L2 cache of G3 processor
c13182ef
MK
1930boards.
1931If 0, the cache is disabled.
eba72288 1932Enabled if non-zero.
fea681da
MK
1933.TP
1934.I /proc/sys/kernel/modprobe
6ab7c0aa
MK
1935This file contains the path for the kernel module loader.
1936The default value is
1937.IR /sbin/modprobe .
1938The file is only present if the kernel is built with the
821643a8
MK
1939.B CONFIG_KMOD
1940option enabled.
6ab7c0aa
MK
1941It is described by the kernel source file
1942.I Documentation/kmod.txt
1943(only present in kernel 2.4 and earlier).
fea681da
MK
1944.TP
1945.I /proc/sys/kernel/msgmax
1946This file defines
1947a system-wide limit specifying the maximum number of bytes in
1948a single message written on a System V message queue.
1949.TP
1950.I /proc/sys/kernel/msgmni
1951This file defines the system-wide limit on the number of
1952message queue identifiers.
1953(This file is only present in Linux 2.4 onwards.)
1954.TP
1955.I /proc/sys/kernel/msgmnb
d9bfdb9c 1956This file defines a system-wide parameter used to initialize the
fea681da 1957.I msg_qbytes
568105c6 1958setting for subsequently created message queues.
fea681da
MK
1959The
1960.I msg_qbytes
1961setting specifies the maximum number of bytes that may be written to the
1962message queue.
1963.TP
1964.IR /proc/sys/kernel/ostype " and " /proc/sys/kernel/osrelease
1965These files
1966give substrings of
1967.IR /proc/version .
1968.TP
1969.IR /proc/sys/kernel/overflowgid " and " /proc/sys/kernel/overflowuid
1970These files duplicate the files
1971.I /proc/sys/fs/overflowgid
1972and
1973.IR /proc/sys/fs/overflowuid .
1974.TP
1975.I /proc/sys/kernel/panic
1976gives read/write access to the kernel variable
1977.IR panic_timeout .
eba72288 1978If this is zero, the kernel will loop on a panic; if non-zero
fea681da 1979it indicates that the kernel should autoreboot after this number
c13182ef
MK
1980of seconds.
1981When you use the
fea681da
MK
1982software watchdog device driver, the recommended setting is 60.
1983.TP
1984.I /proc/sys/kernel/panic_on_oops
d9bfdb9c 1985This file (new in Linux 2.5) controls the kernel's behavior when an oops
c13182ef
MK
1986or BUG is encountered.
1987If this file contains 0, then the system
1988tries to continue operation.
1989If it contains 1, then the system
fea681da 1990delays a few seconds (to give klogd time to record the oops output)
c13182ef 1991and then panics.
fea681da
MK
1992If the
1993.I /proc/sys/kernel/panic
eba72288 1994file is also non-zero then the machine will be rebooted.
fea681da
MK
1995.TP
1996.I /proc/sys/kernel/pid_max
c13182ef 1997This file
fea681da
MK
1998(new in Linux 2.5)
1999specifies the value at which PIDs wrap around
2000(i.e., the value in this file is one greater than the maximum PID).
2001The default value for this file, 32768,
2002results in the same range of PIDs as on earlier kernels.
c13182ef 2003On 32-bit platforms, 32768 is the maximum value for
b3b8bd24 2004.IR pid_max .
c13182ef 2005On 64-bit systems,
b3b8bd24
MK
2006.I pid_max
2007can be set to any value up to 2^22
b1b0eb73
MK
2008.RB ( PID_MAX_LIMIT ,
2009approximately 4 million).
c13182ef 2010.\" Prior to 2.6.10, pid_max could also be raised above 32768 on 32-bit
b3b8bd24
MK
2011.\" platforms, but this broke /proc/PID
2012.\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=109513010926152&w=2
fea681da
MK
2013.TP
2014.IR /proc/sys/kernel/powersave-nap " (PowerPC only)"
c13182ef 2015This file contains a flag.
6c04f928 2016If set, Linux-PPC will use the "nap" mode of
fea681da 2017powersaving,
6c04f928 2018otherwise the "doze" mode will be used.
fea681da
MK
2019.TP
2020.I /proc/sys/kernel/printk
2021The four values in this file
2022are console_loglevel, default_message_loglevel, minimum_console_level and
2023default_console_loglevel.
2024These values influence printk() behavior when printing or
c13182ef
MK
2025logging error messages.
2026See
fea681da
MK
2027.BR syslog (2)
2028for more info on the different loglevels.
2029Messages with a higher priority than
2030console_loglevel will be printed to the console.
2031Messages without an explicit priority
2032will be printed with priority default_message_level.
2033minimum_console_loglevel is the minimum (highest) value to which
2034console_loglevel can be set.
2035default_console_loglevel is the default value for console_loglevel.
2036.TP
2037.IR /proc/sys/kernel/pty " (since Linux 2.6.4)"
c13182ef 2038This directory
fea681da
MK
2039contains two files relating to the number of Unix 98
2040pseudo-terminals (see
2041.BR pts (4))
2042on the system.
2043.TP
2044.I /proc/sys/kernel/pty/max
2045This file defines the maximum number of pseudo-terminals.
2046.TP
2047.I /proc/sys/kernel/pty/nr
2048This read-only file
2049indicates how many pseudo-terminals are currently in use.
2050.TP
fea681da
MK
2051.I /proc/sys/kernel/random
2052This directory
2053contains various parameters controlling the operation of the file
2054.IR /dev/random .
c13182ef 2055See
95a32af8
MK
2056.BR random (4)
2057for further information.
fea681da
MK
2058.TP
2059.I /proc/sys/kernel/real-root-dev
2060This file
9a67332e
MK
2061is documented in the kernel source file
2062.IR Documentation/initrd.txt .
fea681da
MK
2063.TP
2064.IR /proc/sys/kernel/reboot-cmd " (Sparc only) "
2065This file seems to be a way to give an argument to the SPARC
c13182ef
MK
2066ROM/Flash boot loader.
2067Maybe to tell it what to do after
fea681da
MK
2068rebooting?
2069.TP
2070.I /proc/sys/kernel/rtsig-max
c13182ef 2071(Only in kernels up to and including 2.6.7; see
70556c17 2072.BR setrlimit (2))
fea681da 2073This file can be used to tune the maximum number
6f36deb4 2074of POSIX real-time (queued) signals that can be outstanding
fea681da
MK
2075in the system.
2076.TP
2077.I /proc/sys/kernel/rtsig-nr
70556c17 2078(Only in kernels up to and including 2.6.7.)
6f36deb4 2079This file shows the number POSIX real-time signals currently queued.
fea681da
MK
2080.TP
2081.IR /proc/sys/kernel/sem " (since Linux 2.4)"
2082This file contains 4 numbers defining limits for System V IPC semaphores.
c13182ef 2083These fields are, in order:
fea681da
MK
2084.RS
2085.IP SEMMSL 8
2086The maximum semaphores per semaphore set.
2087.IP SEMMNS 8
2088A system-wide limit on the number of semaphores in all semaphore sets.
2089.IP SEMOPM 8
2090The maximum number of operations that may be specified in a
2091.BR semop (2)
2092call.
2093.IP SEMMNI 8
2094A system-wide limit on the maximum number of semaphore identifiers.
2095.RE
2096.TP
2097.I /proc/sys/kernel/sg-big-buff
c13182ef 2098This file
fea681da 2099shows the size of the generic SCSI device (sg) buffer.
5ec8d26f 2100You can't tune it just yet, but you could change it at
9a67332e
MK
2101compile time by editing
2102.I include/scsi/sg.h
2103and changing
b1b0eb73
MK
2104the value of
2105.BR SG_BIG_BUFF .
c13182ef 2106However, there shouldn't be any reason to change this value.
fea681da
MK
2107.TP
2108.I /proc/sys/kernel/shmall
2109This file
2110contains the system-wide limit on the total number of pages of
2111System V shared memory.
2112.TP
2113.I /proc/sys/kernel/shmmax
2114This file
cf50118f 2115can be used to query and set the run-time limit
c13182ef 2116on the maximum (System V IPC) shared memory segment size that can be
fea681da 2117created.
b1b0eb73 2118Shared memory segments up to 1GB are now supported in the
c13182ef 2119kernel.
b1b0eb73
MK
2120This value defaults to
2121.BR SHMMAX .
fea681da
MK
2122.TP
2123.I /proc/sys/kernel/shmmni
2124(available in Linux 2.4 and onwards)
2125This file
2126specifies the system-wide maximum number of System V shared memory
2127segments that can be created.
2128.TP
2129.I /proc/sys/kernel/version
2130contains a string like:
fea681da 2131
3c1a1cdc 2132 #5 Wed Feb 25 21:49:24 MET 1998
fea681da 2133
6c04f928 2134The "#5" means that
fea681da
MK
2135this is the fifth kernel built from this source base and the
2136date behind it indicates the time the kernel was built.
2137.TP
2138.IR /proc/sys/kernel/zero-paged " (PowerPC only) "
2139This file
c13182ef 2140contains a flag.
eba72288 2141When enabled (non-zero), Linux-PPC will pre-zero pages in
fea681da
MK
2142the idle loop, possibly speeding up get_free_pages.
2143.TP
2144.I /proc/sys/net
2145This directory contains networking stuff.
81c6dd6c
MK
2146Explanations for some of the files under this directory can be found in
2147.BR tcp (7)
2148and
2149.BR ip (7).
fea681da 2150.TP
ec650cc1
MK
2151.I /proc/sys/net/core/somaxconn
2152This file defines a ceiling value for the
2153.I backlog
2154argument of
2155.BR listen (2);
2156see the
2157.BR listen (2)
2158manual page for details.
2159.TP
fea681da
MK
2160.I /proc/sys/proc
2161This directory may be empty.
2162.TP
2163.I /proc/sys/sunrpc
2164This directory supports Sun remote procedure call for network file system
c13182ef
MK
2165(NFS).
2166On some systems, it is not present.
fea681da
MK
2167.TP
2168.I /proc/sys/vm
c13182ef 2169This directory contains files for memory management tuning, buffer and
fea681da
MK
2170cache
2171management.
2172.TP
b6c40587
MK
2173.IR /proc/sys/vm/drop_caches " (since Linux 2.6.16)"
2174Writing to this file causes the kernel to drop clean caches, dentries and
2175inodes from memory, causing that memory to become free.
2176
c13182ef 2177To free pagecache, use
b6c40587
MK
2178.IR "echo 1 > /proc/sys/vm/drop_caches" ;
2179to free dentries and inodes, use
2180.IR "echo 2 > /proc/sys/vm/drop_caches" ;
2181to free pagecache, dentries and inodes, use
2182.IR "echo 3 > /proc/sys/vm/drop_caches" .
2183
c13182ef 2184Because this is a non-destructive operation and dirty objects
b6c40587 2185are not freeable, the
c13182ef 2186user should run
b6c40587
MK
2187.BR sync (8)
2188first.
2189.TP
473ad28f
MK
2190.IR /proc/sys/vm/legacy_va_layout " (since Linux 2.6.9)"
2191.\" The following is from Documentation/filesystems/proc.txt
eba72288 2192If non-zero, this disable the new 32-bit memory-mapping layout;
473ad28f
MK
2193the kernel will use the legacy (2.4) layout for all processes.
2194.TP
fea681da 2195.I /proc/sys/vm/overcommit_memory
c13182ef
MK
2196This file contains the kernel virtual memory accounting mode.
2197Values are:
fea681da
MK
2198.br
21990: heuristic overcommit (this is the default)
2200.br
22011: always overcommit, never check
2202.br
22032: always check, never overcommit
2204.br
2205In mode 0, calls of
2206.BR mmap (2)
097585ed 2207with
0daa9e92 2208.B MAP_NORESERVE
097585ed 2209set are not checked, and the default check is very weak,
fea681da 2210leading to the risk of getting a process "OOM-killed".
eba72288 2211Under Linux 2.4 any non-zero value implies mode 1.
fea681da
MK
2212In mode 2 (available since Linux 2.6), the total virtual address space
2213on the system is limited to (SS + RAM*(r/100)),
2214where SS is the size of the swap space, and RAM
2215is the size of the physical memory, and r is the contents of the file
2216.IR /proc/sys/vm/overcommit_ratio .
2217.TP
2218.I /proc/sys/vm/overcommit_ratio
c13182ef 2219See the description of
fea681da
MK
2220.IR /proc/sys/vm/overcommit_memory .
2221.TP
2222.I /proc/sysvipc
c13182ef 2223Subdirectory containing the pseudo-files
fea681da 2224.IR msg ", " sem " and " shm "."
c13182ef 2225These files list the System V Interprocess Communication (IPC) objects
fea681da
MK
2226(respectively: message queues, semaphores, and shared memory)
2227that currently exist on the system,
2228providing similar information to that available via
2229.BR ipcs (1).
2230These files have headers and are formatted (one IPC object per line)
2231for easy understanding.
2c5e151c 2232.BR svipc (7)
fea681da
MK
2233provides further background on the information shown by these files.
2234.TP
2235.I /proc/tty
c13182ef 2236Subdirectory containing the pseudo-files and subdirectories for
fea681da
MK
2237tty drivers and line disciplines.
2238.TP
2239.I /proc/uptime
2240This file contains two numbers: the uptime of the system (seconds),
2241and the amount of time spent in idle process (seconds).
2242.TP
2243.I /proc/version
2244This string identifies the kernel version that is currently running.
030d3025
MK
2245It includes the contents of
2246.IR /proc/sys/kernel/ostype ,
0daa9e92 2247.I /proc/sys/kernel/osrelease
030d3025
MK
2248and
2249.IR /proc/sys/kernel/version .
c13182ef 2250For example:
fea681da
MK
2251.nf
2252.in -2
2253.ft CW
2254Linux version 1.0.9 (quinlan@phaze) #1 Sat May 14 01:51:54 EDT 1994
2255.ft
2256.in +2
2257.fi
b4e9ee8f
MK
2258.\" FIXME Document /proc/timer_list
2259.\" .TP
2260.\" .IR /proc/timer_list " (since Linux 2.6.21)"
2261.\" See the 2.6.21 Change log
2262.\" FIXME Document /proc/timer_stats
2263.\" .TP
2264.\" .IR /proc/timer_stats " (since Linux 2.6.21)"
2265.\" See the 2.6.21 Change log
fea681da
MK
2266.TP
2267.IR /proc/vmstat " (since Linux 2.6)"
2268This file displays various virtual memory statistics.
363f747c
MK
2269.TP
2270.IR /proc/zoneinfo " (since Linux 2.6.13)"
2271This file display information about memory zones.
d9bfdb9c 2272This is useful for analyzing virtual memory behavior.
218e46f8 2273.\" FIXME more should be said about /proc/zoneinfo
e37e3282
MK
2274.SH NOTES
2275Many strings (i.e., the environment and command line) are in
f81fb444 2276the internal format, with sub-fields terminated by null bytes (\(aq\\0\(aq),
e37e3282
MK
2277so you
2278may find that things are more readable if you use \fIod \-c\fP or \fItr
2279"\\000" "\\n"\fP to read them.
26868e5b 2280Alternatively, \fIecho \`cat <file>\`\fP works well.
e37e3282
MK
2281
2282This manual page is incomplete, possibly inaccurate, and is the kind
2283of thing that needs to be updated very often.
2284.\" .SH ACKNOWLEDGEMENTS
2285.\" The material on /proc/sys/fs and /proc/sys/kernel is closely based on
2286.\" kernel source documentation files written by Rik van Riel.
fea681da
MK
2287.SH "SEE ALSO"
2288.BR cat (1),
2289.BR find (1),
2290.BR free (1),
fea681da
MK
2291.BR ps (1),
2292.BR tr (1),
2293.BR uptime (1),
2294.BR chroot (2),
2295.BR mmap (2),
2296.BR readlink (2),
2297.BR syslog (2),
2298.BR slabinfo (5),
2299.BR hier (7),
2300.BR arp (8),
2301.BR dmesg (8),
2302.BR hdparm (8),
2303.BR ifconfig (8),
2304.BR init (8),
2305.BR lsmod (8),
2306.BR lspci (8),
809d0164 2307.BR mount (8),
fea681da
MK
2308.BR netstat (8),
2309.BR procinfo (8),
2310.BR route (8)
2311.br
2312.I /usr/src/linux/Documentation/filesystems/proc.txt