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