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