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