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