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