man-pages/man5/proc.5

1880 lines
56 KiB
Groff
Raw Normal View History

2004-11-03 13:51:07 +00:00
.\" Copyright (C) 1994, 1995 by Daniel Quinlan (quinlan@yggdrasil.com)
.\" with networking additions from Alan Cox (A.Cox@swansea.ac.uk)
.\" and scsi additions from Michael Neuffer (neuffer@mail.uni-mainz.de)
.\" and sysctl additions from Andries Brouwer (aeb@cwi.nl)
.\" and System V IPC (as well as various other) additions from
2007-09-20 06:52:22 +00:00
.\" Michael Kerrisk <mtk.manpages@gmail.com>
2004-11-03 13:51:07 +00:00
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.\"
.\" Modified 1995-05-17 by faith@cs.unc.edu
.\" Minor changes by aeb and Marty Leisner (leisner@sdsp.mc.xerox.com).
.\" Modified 1996-04-13, 1996-07-22 by aeb@cwi.nl
.\" Modified 2001-12-16 by rwhron@earthlink.net
.\" Modified 2002-07-13 by jbelton@shaw.ca
.\" Modified 2002-07-22, 2003-05-27, 2004-04-06, 2004-05-25
2007-09-20 06:52:22 +00:00
.\" by Michael Kerrisk <mtk.manpages@gmail.com>
.\" 2004-11-17, mtk -- updated notes on /proc/loadavg
.\" 2004-12-01, mtk, rtsig-max and rtsig-nr went away in 2.6.8
.\" 2004-12-14, mtk, updated 'statm', and fixed error in order of list
.\" 2005-05-12, mtk, updated 'stat'
.\" 2005-07-13, mtk, added /proc/sys/fs/mqueue/*
.\" 2005-09-16, mtk, Added /proc/sys/fs/suid_dumpable
.\" 2005-09-19, mtk, added /proc/zoneinfo
.\" 2005-03-01, mtk, moved /proc/sys/fs/mqueue/* material to
.\" mq_overview.7.
.\"
.\" FIXME 2.6.14 has /proc/PID/numa_maps (if CONFIG_NUMA is
.\" enabled); this needs to be documented.
.\" Info on numa_maps can be found in the patch-2.6.14
.\" Changelog, but this is possibly not up to date.
2006-03-05 20:45:41 +00:00
.\"
2006-02-10 18:46:42 +00:00
.\" FIXME 2.6.13 seems to have /proc/vmcore implemented
.\" in the source code, but there is no option available under
.\" 'make xconfig'; eventually this should be fixed, and then info
.\" from the patch-2.6.13 and change log could be used to write an
2006-02-10 18:46:42 +00:00
.\" entry in this man page.
2006-03-05 20:45:41 +00:00
.\"
.\" FIXME cross check against Documentation/filesystems/proc.txt
.\" to see what information could be imported from that file
2006-02-10 18:46:42 +00:00
.\" into this file.
2004-11-03 13:51:07 +00:00
.\"
2007-11-24 07:49:41 +00:00
.TH PROC 5 2007-11-30 "Linux" "Linux Programmer's Manual"
2004-11-03 13:51:07 +00:00
.SH NAME
proc \- process information pseudo-filesystem
.SH DESCRIPTION
The
.I proc
filesystem is a pseudo-filesystem which is used as an interface to
kernel data structures.
It is commonly mounted at
2004-11-03 13:51:07 +00:00
.IR /proc .
Most of it is read-only, but some files allow kernel variables to be
2004-11-03 13:51:07 +00:00
changed.
.LP
The following outline gives a quick tour through the /proc hierarchy.
.PD 1
.TP
.I /proc/[number]
There is a numerical subdirectory for each running process; the
subdirectory is named by the process ID.
Each such subdirectory contains the following
pseudo-files and directories.
.TP
2006-08-09 09:56:44 +00:00
.IR /proc/[number]/auxv " (since 2.6.0-test7)"
This contains the contents of the ELF interpreter information passed
to the process at exec time.
2006-08-09 09:56:44 +00:00
The format is one \fIunsigned long\fP ID
plus one \fIunsigned long\fP value for each entry.
2006-08-09 09:56:44 +00:00
The last entry contains two zeros.
.TP
2004-11-03 13:51:07 +00:00
.I /proc/[number]/cmdline
This holds the complete command line for the process, unless the whole
process has been swapped out or the process is a zombie.
In either of these latter cases, there is nothing in this file:
that is, a read on this file will return 0 characters.
The command line arguments appear in this file as a set of
2004-11-03 13:51:07 +00:00
null-separated strings, with a further null byte after the last string.
.TP
.I /proc/[number]/cwd
This is a symbolic link to the current working directory of the process.
To find out the cwd of process 20, for instance, you can do this:
2004-11-03 13:51:07 +00:00
.br
.nf
.ft CW
cd /proc/20/cwd; /bin/pwd
.fi
.ft
Note that the
.I pwd
command is often a shell builtin, and might
not work properly.
In bash, you may use pwd \-P.
.\" The following was still true as at kernel 2.6.13
In a multithreaded process, the contents of this symbolic link
are not available if the main thread has already terminated
(typically by calling
.BR pthread_exit (3).
2004-11-03 13:51:07 +00:00
.TP
.I /proc/[number]/environ
This file contains the environment for the process.
The entries are separated by null bytes ('\\0'),
and there may be a null bytes at the end.
2004-11-03 13:51:07 +00:00
Thus, to print out the environment of process 1, you would do:
.in +4n
2004-11-03 13:51:07 +00:00
.nf
2004-11-03 13:51:07 +00:00
.ft CW
(cat /proc/1/environ; echo) | tr "\\000" "\\n"
.fi
.ft P
.in
2004-11-03 13:51:07 +00:00
(For a reason why one should want to do this, see
.BR lilo (8)
or
.BR grub (8).)
2004-11-03 13:51:07 +00:00
.TP
.I /proc/[number]/exe
Under Linux 2.2 and later, this file is a symbolic link
2006-02-12 22:19:08 +00:00
containing the actual pathname of the executed command.
This symbolic link can be dereferenced normally; attempting to open
it will open the executable.
You can even type
2004-11-03 13:51:07 +00:00
.I /proc/[number]/exe
to run another copy of the same executable as is being run by
2005-06-24 15:56:02 +00:00
process [number].
.\" The following was still true as at kernel 2.6.13
In a multithreaded process, the contents of this symbolic link
are not available if the main thread has already terminated
(typically by calling
.BR pthread_exit (3)).
2004-11-03 13:51:07 +00:00
Under Linux 2.0 and earlier
.I /proc/[number]/exe
is a pointer to the binary which was executed,
and appears as a symbolic link.
A
2004-11-03 13:51:07 +00:00
.BR readlink (2)
call on this file under Linux 2.0 returns a string in the format:
[device]:inode
For example, [0301]:1502 would be inode 1502 on device major 03 (IDE,
MFM, etc. drives) minor 01 (first partition on the first drive).
.BR find (1)
2005-07-06 07:41:37 +00:00
with the \-inum option can be used to locate the file.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/[number]/fd
This is a subdirectory containing one entry for each file which the
process has open, named by its file descriptor, and which is a
symbolic link to the actual file.
Thus, 0 is standard input, 1 standard output, 2 standard error, etc.
2004-11-03 13:51:07 +00:00
.\" The following was still true as at kernel 2.6.13
In a multithreaded process, the contents of this directory
are not available if the main thread has already terminated
(typically by calling
.BR pthread_exit (3)).
2004-11-03 13:51:07 +00:00
Programs that will take a filename, but will not take the standard
input, and which write to a file, but will not send their output to
2005-07-06 07:41:37 +00:00
standard output, can be effectively foiled this way, assuming that \-i
is the flag designating an input file and \-o is the flag designating
2004-11-03 13:51:07 +00:00
an output file:
.in +4n
2004-11-03 13:51:07 +00:00
.nf
2005-07-06 12:57:38 +00:00
\f(CWfoobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ...\fR
2004-11-03 13:51:07 +00:00
.fi
.in
2004-11-03 13:51:07 +00:00
and you have a working filter.
.\" The following is not true in my tests (MTK):
.\" Note that this will not work for
.\" programs that seek on their files, as the files in the fd directory
.\" are not seekable.
/proc/self/fd/N is approximately the same as /dev/fd/N in some UNIX
and UNIX-like systems.
Most Linux MAKEDEV scripts symbolically link
2004-11-03 13:51:07 +00:00
/dev/fd to /proc/self/fd, in fact.
.\" FIXME Describe /proc/[number]/loginuid
.\" Added in 2.6.11; updating requires CAP_AUDIT_CONTROL
2004-11-03 13:51:07 +00:00
.TP
.I /proc/[number]/maps
A file containing the currently mapped memory regions and their access
permissions.
The format is:
.nf
.ft CW
.in 8n
address perms offset dev inode pathname
08048000-08056000 r-xp 00000000 03:0c 64593 /usr/sbin/gpm
08056000-08058000 rw-p 0000d000 03:0c 64593 /usr/sbin/gpm
08058000-0805b000 rwxp 00000000 00:00 0
40000000-40013000 r-xp 00000000 03:0c 4165 /lib/ld-2.2.4.so
40013000-40015000 rw-p 00012000 03:0c 4165 /lib/ld-2.2.4.so
4001f000-40135000 r-xp 00000000 03:0c 45494 /lib/libc-2.2.4.so
40135000-4013e000 rw-p 00115000 03:0c 45494 /lib/libc-2.2.4.so
4013e000-40142000 rw-p 00000000 00:00 0
bffff000-c0000000 rwxp 00000000 00:00 0
.ft
.fi
.in
where address is the address space in the process that it occupies,
perms is a set of permissions:
.nf
.in +5
r = read
w = write
x = execute
s = shared
p = private (copy on write)
.fi
.in
offset is the offset into the file/whatever, dev is the device
(major:minor), and inode is the inode on that device. 0 indicates
that no inode is associated with the memory region, as the case would
be with bss.
Under Linux 2.0 there is no field giving pathname.
.TP
.I /proc/[number]/mem
This file can be used to access the pages of a process's memory through
.BR open (2),
.BR read (2),
and
2006-11-28 04:22:24 +00:00
.BR lseek (2).
2006-07-06 12:38:53 +00:00
.\" FIXME Describe /proc/[number]/mountstats and
.\" /proc/PID/task/TID/mountstats
.\" Some information can be found in the 2.6.17-rc1 change log.
2006-07-01 05:04:14 +00:00
.\" Added in 2.6.17
2006-07-06 12:38:53 +00:00
.\"
.\" FIXME Describe /proc/[number]/oom_adj
2006-01-18 08:18:46 +00:00
.\" Added in 2.6.11; updating requires CAP_SYS_RESOURCE
.\" Mention OOM_DISABLE (-17)
.\" FIXME Describe /proc/[number]/oom_score
.\" Added in 2.6.11; read-only
2004-11-03 13:51:07 +00:00
.TP
.I /proc/[number]/root
Unix and Linux support the idea of a per-process root of the
filesystem, set by the
.BR chroot (2)
system call.
This file is a symbolic link that points to the process's
2004-11-03 13:51:07 +00:00
root directory, and behaves as exe, fd/*, etc. do.
.\" The following was still true as at kernel 2.6.13
In a multithreaded process, the contents of this symbolic link
are not available if the main thread has already terminated
(typically by calling
.BR pthread_exit (3)).
.\" FIXME Describe /proc/[number]/seccomp
.\" Added in 2.6.12
2004-11-03 13:51:07 +00:00
.TP
.IR /proc/[number]/smaps " (since Linux 2.6.14)"
This file shows memory consumption for each of the process's mappings.
For each of mappings there is a series of lines as follows:
.in +4n
.nf
08048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash
Size: 464 kB
Rss: 424 kB
Shared_Clean: 424 kB
Shared_Dirty: 0 kB
Private_Clean: 0 kB
Private_Dirty: 0 kB
.fi
.in
The first of these lines shows the same information as is displayed
for the mapping in
.IR /proc/[number]/maps .
The remaining lines show the size of the mapping,
the amount of the mapping that is currently resident in RAM,
the number clean and dirty shared pages in the mapping,
and the number clean and dirty private pages in the mapping.
2007-06-22 20:40:07 +00:00
This file is only present if the
.B CONFIG_MMU
kernel configuration
option is enabled.
.TP
2004-11-03 13:51:07 +00:00
.I /proc/[number]/stat
Status information about the process.
This is used by
.BR ps (1).
It is defined in
2004-11-03 13:51:07 +00:00
.IR /usr/src/linux/fs/proc/array.c "."
The fields, in order, with their proper
.BR scanf (3)
format specifiers, are:
.RS
.TP
\fIpid\fP %d
2005-07-18 16:02:32 +00:00
The process ID.
2004-11-03 13:51:07 +00:00
.TP
\fIcomm\fP %s
The filename of the executable, in parentheses.
This is visible whether or not the executable is swapped out.
2004-11-03 13:51:07 +00:00
.TP
\fIstate\fP %c
One character from the string "RSDZTW" where R is running, S is
sleeping in an interruptible wait, D is waiting in uninterruptible
disk sleep, Z is zombie, T is traced or stopped (on a signal),
and W is paging.
.TP
\fIppid\fP %d
The PID of the parent.
.TP
\fIpgrp\fP %d
The process group ID of the process.
.TP
\fIsession\fP %d
The session ID of the process.
.TP
.\" tty_nr needs better explanation.
\fItty_nr\fP %d
The tty the process uses.
.TP
\fItpgid\fP %d
.\" This field and following, up to and including wchan added 0.99.1
The process group ID of the process which currently owns the tty that
the process is connected to.
.TP
\fIflags\fP %u (%lu before Linux 2.6.22)
The kernel flags word of the process.
For bit meanings,
2004-11-03 13:51:07 +00:00
see the PF_* defines in
.IR <linux/sched.h> .
Details depend on the kernel version.
.TP
\fIminflt\fP %lu
The number of minor faults the process has made which have not
required loading a memory page from disk.
.TP
\fIcminflt\fP %lu
The number of minor faults that the process's
waited-for children have made.
.TP
\fImajflt\fP %lu
The number of major faults the process has made which have
required loading a memory page from disk.
.TP
\fIcmajflt\fP %lu
The number of major faults that the process's
waited-for children have made.
.TP
\fIutime\fP %lu
The number of jiffies that this process has been scheduled in user
mode.
.TP
\fIstime\fP %lu
The number of jiffies that this process has been scheduled in kernel
mode.
.TP
\fIcutime\fP %ld
The number of jiffies that this process's
waited-for children have been scheduled in user mode.
(See also
2004-11-03 13:51:07 +00:00
.BR times (2).)
.TP
\fIcstime\fP %ld
The number of jiffies that this process's
waited-for children have been scheduled in kernel mode.
.TP
\fIpriority\fP %ld
The standard nice value, plus fifteen.
The value is never negative in the kernel.
2004-11-03 13:51:07 +00:00
.TP
\fInice\fP %ld
2005-06-15 14:10:23 +00:00
The nice value ranges from 19 (nicest) to \-19 (not nice to others).
2004-11-03 13:51:07 +00:00
.TP
.\" .TP
.\" \fIcounter\fP %ld
.\" The current maximum size in jiffies of the process's next timeslice,
.\" or what is currently left of its current timeslice, if it is the
.\" currently running process.
.\" .TP
.\" \fItimeout\fP %u
.\" The time in jiffies of the process's next timeout.
.\" timeout was removed sometime around 2.1/2.2
\fInum_threads\fP %ld
Number of threads in this process (since Linux 2.6).
2007-07-07 18:50:56 +00:00
Before kernel 2.6, this field was hard coded to 0 as a placeholder
for an earlier removed field.
2004-11-03 13:51:07 +00:00
.TP
\fIitrealvalue\fP %ld
2007-06-21 05:38:48 +00:00
The time in jiffies before the next
.B SIGALRM
is sent to the process due to an interval timer.
Since kernel 2.6.17, this field is no longer maintained,
and is hard coded as 0.
2004-11-03 13:51:07 +00:00
.TP
\fIstarttime\fP %llu (was %lu before Linux 2.6)
2004-11-03 13:51:07 +00:00
The time in jiffies the process started after system boot.
.TP
\fIvsize\fP %lu
Virtual memory size in bytes.
.TP
\fIrss\fP %ld
Resident Set Size: number of pages the process has in real memory,
minus 3 for administrative purposes.
This is just the pages which
count towards text, data, or stack space.
This does not include pages
2004-11-03 13:51:07 +00:00
which have not been demand-loaded in, or which are swapped out.
.TP
\fIrlim\fP %lu
Current limit in bytes on the rss of the process (usually
4294967295 on i386).
.TP
\fIstartcode\fP %lu
The address above which program text can run.
.TP
\fIendcode\fP %lu
The address below which program text can run.
.TP
\fIstartstack\fP %lu
The address of the start of the stack.
.TP
\fIkstkesp\fP %lu
The current value of esp (stack pointer), as found in the
kernel stack page for the process.
.TP
\fIkstkeip\fP %lu
The current EIP (instruction pointer).
.TP
\fIsignal\fP %lu
The bitmap of pending signals.
2004-11-03 13:51:07 +00:00
.TP
\fIblocked\fP %lu
The bitmap of blocked signals.
2004-11-03 13:51:07 +00:00
.TP
\fIsigignore\fP %lu
The bitmap of ignored signals.
.TP
\fIsigcatch\fP %lu
The bitmap of caught signals.
2004-11-03 13:51:07 +00:00
.TP
\fIwchan\fP %lu
This is the "channel" in which the process is waiting.
It is the
2004-11-03 13:51:07 +00:00
address of a system call, and can be looked up in a namelist if you
need a textual name.
2007-10-03 19:48:21 +00:00
(If you have an up-to-date
.IR /etc/psdatabase ,
then
2005-07-06 07:41:37 +00:00
try \fIps \-l\fP to see the WCHAN field in action.)
2004-11-03 13:51:07 +00:00
.TP
\fInswap\fP %lu
.\" nswap was added in 2.0
2005-07-06 07:41:37 +00:00
Number of pages swapped (not maintained).
2004-11-03 13:51:07 +00:00
.TP
\fIcnswap\fP %lu
.\" cnswap was added in 2.0
2005-07-06 07:41:37 +00:00
Cumulative \fInswap\fP for child processes (not maintained).
2004-11-03 13:51:07 +00:00
.TP
\fIexit_signal\fP %d (since Linux 2.1.22)
2004-11-03 13:51:07 +00:00
Signal to be sent to parent when we die.
.TP
\fIprocessor\fP %d (since Linux 2.2.8)
2004-11-03 13:51:07 +00:00
CPU number last executed on.
.TP
\fIrt_priority\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
Real-time scheduling priority (see
.BR sched_setscheduler (2)).
.TP
\fIpolicy\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22)
Scheduling policy (see
.BR sched_setscheduler (2)).
.TP
\fIdelayacct_blkio_ticks\fP %llu (since Linux 2.6.18)
Aggregated block I/O delays, measured in clock ticks (centiseconds).
2004-11-03 13:51:07 +00:00
.RE
.TP
.I /proc/[number]/statm
Provides information about memory status in pages.
The columns are:
.in +4n
.nf
size total program size
resident resident set size
share shared pages
text text (code)
lib library
data data/stack
dt dirty pages (unused in Linux 2.6)
.fi
.in
2004-11-03 13:51:07 +00:00
.TP
.I /proc/[number]/status
Provides much of the information in
.I /proc/[number]/stat
and
.I /proc/[number]/statm
in a format that's easier for humans to parse.
.TP
.IR /proc/[number]/task " (since Linux 2.6.0-test6)"
This is a directory that contains one subdirectory
for each thread in the process.
The name of each subdirectory is the numerical thread ID of the
thread (see
.BR gettid (2)).
Within each of these subdirectories, there is a set of
files with the same names and contents as under the
.I /proc/[number]
directories.
For attributes that are shared by all threads, the contents for
each of the files under the
.I task/[thread-ID]
subdirectories will be the same as in the corresponding
file in the parent
.I /proc/[number]
directory
(e.g., in a multithreaded process, all of the
.I task/[thread-ID]/cwd
files will have the same value as the
.I /proc/[number]/cwd
file in the parent directory, since all of the threads in a process
share a working directory).
For attributes that are distinct for each thread,
the corresponding files under
.I task/[thread-ID]
may have different values (e.g., various fields in each of the
.I task/[thread-ID]/status
files may be different for each thread).
.\" The following was still true as at kernel 2.6.13
In a multithreaded process, the contents of the
.I /proc/[number]/task
directory are not available if the main thread has already terminated
(typically by calling
.BR pthread_exit (3)).
.TP
2004-11-03 13:51:07 +00:00
.I /proc/apm
2007-06-22 20:40:07 +00:00
Advanced power management version and battery information when
.B CONFIG_APM
is defined at kernel compilation time.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/bus
Contains subdirectories for installed busses.
.TP
.I /proc/bus/pccard
2007-06-22 20:40:07 +00:00
Subdirectory for pcmcia devices when
.B CONFIG_PCMCIA
is set at kernel compilation time.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/bus/pccard/drivers
.TP
.I /proc/bus/pci
Contains various bus subdirectories and pseudo-files containing
information about pci busses, installed devices, and device
drivers.
Some of these files are not ASCII.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/bus/pci/devices
Information about pci devices.
They may be accessed through
2004-11-03 13:51:07 +00:00
.BR lspci (8)
and
.BR setpci (8).
.TP
.I /proc/cmdline
Arguments passed to the Linux kernel at boot time.
Often done via a boot manager such as
2004-11-03 13:51:07 +00:00
.BR lilo (1).
2006-04-19 21:11:07 +00:00
.\" FIXME Document /proc/config.gz (new in kernel 2.6)
2004-11-03 13:51:07 +00:00
.TP
.I /proc/cpuinfo
This is a collection of CPU and system architecture dependent items,
for each supported architecture a different list.
Two common entries are \fIprocessor\fP which gives CPU number and
\fIbogomips\fP; a system constant that is calculated
during kernel initialization.
SMP machines have information for
2004-11-03 13:51:07 +00:00
each CPU.
.TP
.I /proc/devices
Text listing of major numbers and device groups.
This can be used by MAKEDEV scripts for consistency with the kernel.
2004-11-03 13:51:07 +00:00
.TP
.IR /proc/diskstats " (since Linux 2.5.69)"
This file contains disk I/O statistics for each disk device.
See the kernel source file
.I Documentation/iostats.txt
for further information.
.TP
.I /proc/dma
This is a list of the registered \fIISA\fP DMA (direct memory access)
2004-11-03 13:51:07 +00:00
channels in use.
.TP
.I /proc/driver
Empty subdirectory.
.TP
.I /proc/execdomains
List of the execution domains (ABI personalities).
.TP
.I /proc/fb
2007-06-22 20:40:07 +00:00
Frame buffer information when
.B CONFIG_FB
is defined during kernel compilation.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/filesystems
A text listing of the filesystems which are supported by the kernel,
namely filesystems which were compiled into the kernel or whose kernel
modules are currently loaded. (See also
2007-12-10 09:37:51 +00:00
.BR filesystems (5).)
If a filesystem is marked with "nodev",
this means that it does not require a block device to be mounted
(e.g., virtual filesystem, network filesystem).
Incidentally, this file may be used by
.BR mount (8)
when no filesystem is specified and it didn't manage to determine the
filesystem type.
Then filesystems contained in this file are tried
(excepted those that are marked with "nodev").
2004-11-03 13:51:07 +00:00
.TP
.I /proc/fs
Empty subdirectory.
.TP
.I /proc/ide
This directory
exists on systems with the ide bus.
There are directories for each ide channel and attached device.
Files include:
2004-11-03 13:51:07 +00:00
.in +4n
2004-11-03 13:51:07 +00:00
.nf
cache buffer size in KB
capacity number of sectors
driver driver version
geometry physical and logical geometry
identify in hexadecimal
2004-11-03 13:51:07 +00:00
media media type
model manufacturer's model number
settings drive settings
smart_thresholds in hexadecimal
smart_values in hexadecimal
2004-11-03 13:51:07 +00:00
.fi
.in
2004-11-03 13:51:07 +00:00
The
2004-11-03 13:51:07 +00:00
.BR hdparm (8)
utility provides access to this information in a friendly format.
.TP
.I /proc/interrupts
This is used to record the number of interrupts per each IRQ on (at
least) the i386 architecture.
Very easy to read formatting, done in
2004-11-03 13:51:07 +00:00
ASCII.
.TP
.I /proc/iomem
I/O memory map in Linux 2.4.
.TP
.I /proc/ioports
This is a list of currently registered Input-Output port regions that
2004-11-03 13:51:07 +00:00
are in use.
.TP
.IR /proc/kallsyms " (since Linux 2.5.71)"
This holds the kernel exported symbol definitions used by the
.BR modules (X)
tools to dynamically link and bind loadable modules.
In Linux 2.5.47 and earlier, a similar file with slightly different syntax
was named
.IR ksyms .
.TP
.I /proc/kcore
This file represents the physical memory of the system and is stored
in the ELF core file format.
With this pseudo-file, and an unstripped
2007-10-03 19:48:21 +00:00
kernel
.RI ( /usr/src/linux/vmlinux )
binary, GDB can be used to
2004-11-03 13:51:07 +00:00
examine the current state of any kernel data structures.
The total length of the file is the size of physical memory (RAM) plus
4KB.
.TP
.I /proc/kmsg
This file can be used instead of the
.BR syslog (2)
system call to read kernel messages.
A process must have superuser
2004-11-03 13:51:07 +00:00
privileges to read this file, and only one process should read this
file.
This file should not be read if a syslog process is running
2004-11-03 13:51:07 +00:00
which uses the
.BR syslog (2)
system call facility to log kernel messages.
Information in this file is retrieved with the
.BR dmesg (8)
program.
.TP
.IR /proc/ksyms " (Linux 1.1.23-2.5.47)"
See
.IR /proc/kallsyms .
.TP
.I /proc/loadavg
2004-11-17 10:43:17 +00:00
The first three fields in this file are load average figures
giving the number of jobs in the run queue (state R)
2004-11-03 13:51:07 +00:00
or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes.
They are the same as the load average numbers given by
.BR uptime (1)
and other programs.
2004-11-17 10:43:17 +00:00
The fourth field consists of two numbers separated by a slash (/).
The first of these is the number of currently executing kernel
scheduling entities (processes, threads);
2004-11-17 10:43:17 +00:00
this will be less than or equal to the number of CPUs.
The value after the slash is the number of kernel scheduling entities
that currently exist on the system.
The fifth field is the PID of the process that was most
recently created on the system.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/locks
This file shows current file locks
.RB ( flock "(2) and " fcntl (2))
and leases
.RB ( fcntl (2)).
.TP
2007-06-24 17:00:09 +00:00
.IR /proc/malloc " (only up to and including Linux 2.2)"
2007-06-22 20:40:07 +00:00
This file is only present if
2007-06-24 17:00:09 +00:00
.B CONFIG_DEBUG_MALLOC
2007-06-22 20:40:07 +00:00
was defined during compilation.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/meminfo
This is used by
.BR free (1)
to report the amount of free and used memory (both physical and swap)
on the system as well as the shared memory and buffers used by the
kernel.
It is in the same format as
.BR free (1),
except in bytes rather than KB.
.TP
.I /proc/mounts
This is a list of all the file systems currently mounted on the system.
The format of this file is documented in
.BR fstab (5).
Since kernel version 2.6.15, this file is pollable:
after opening the file for reading, a change in this file
(i.e., a file system mount or unmount) causes
.BR select (2)
to mark the file descriptor as readable, and
.BR poll (2)
and
.BR epoll_wait (2)
mark the file as having an error condition.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/modules
A text list of the modules that have been loaded by the system.
See also
.BR lsmod (8).
.TP
.I /proc/mtrr
Memory Type Range Registers.
See
2004-11-03 13:51:07 +00:00
.I /usr/src/linux/Documentation/mtrr.txt
for details.
.TP
.I /proc/net
various net pseudo-files, all of which give the status of some part of
the networking layer.
These files contain ASCII structures and are,
therefore, readable with cat.
However, the standard
2004-11-03 13:51:07 +00:00
.BR netstat (8)
suite provides much cleaner access to these files.
.TP
.I /proc/net/arp
This holds an ASCII readable dump of the kernel ARP table used for
address resolutions.
It will show both dynamically learned and
pre-programmed ARP entries.
The format is:
2004-11-03 13:51:07 +00:00
.nf
.ft CW
.in 8n
IP address HW type Flags HW address Mask Device
192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0
192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0
.ft
.fi
.in
Here 'IP address' is the IPv4 address of the machine and the 'HW type'
is the hardware type of the address from RFC\ 826.
The flags are the internal
2007-10-03 19:48:21 +00:00
flags of the ARP structure (as defined in
.IR /usr/include/linux/if_arp.h )
and
2004-11-03 13:51:07 +00:00
the 'HW address' is the data link layer mapping for that IP address if
it is known.
.TP
.I /proc/net/dev
The dev pseudo-file contains network device status information.
This gives
the number of received and sent packets, the number of errors and
2004-11-03 13:51:07 +00:00
collisions
and other basic statistics.
These are used by the
2004-11-03 13:51:07 +00:00
.BR ifconfig (8)
program to report device status.
The format is:
2004-11-03 13:51:07 +00:00
.nf
.ft CW
.in 1n
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0
eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0
ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0
tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0
.in
.ft
.fi
.\" .TP
.\" .I /proc/net/ipx
.\" No information.
.\" .TP
.\" .I /proc/net/ipx_route
.\" No information.
.TP
.I /proc/net/dev_mcast
Defined in
.IR /usr/src/linux/net/core/dev_mcast.c :
.nf
.in +5
indx interface_name dmi_u dmi_g dmi_address
2004-11-03 13:51:07 +00:00
2 eth0 1 0 01005e000001
3 eth1 1 0 01005e000001
4 eth2 1 0 01005e000001
.in
.fi
.TP
.I /proc/net/igmp
Internet Group Management Protocol.
Defined in
2004-11-03 13:51:07 +00:00
.IR /usr/src/linux/net/core/igmp.c .
.TP
.I /proc/net/rarp
This file uses the same format as the
.I arp
file and contains the current reverse mapping database used to provide
.BR rarp (8)
reverse address lookup services.
If RARP is not configured into the
2004-11-03 13:51:07 +00:00
kernel,
this file will not be present.
.TP
.I /proc/net/raw
Holds a dump of the RAW socket table.
Much of the information is not of
2004-11-03 13:51:07 +00:00
use
apart from debugging.
The 'sl' value is the kernel hash slot for the
2004-11-03 13:51:07 +00:00
socket,
2007-10-16 19:18:17 +00:00
the 'local_address' is the local address and protocol number pair. "St" is
the internal status of the socket.
The "tx_queue" and "rx_queue" are the
2004-11-03 13:51:07 +00:00
outgoing and incoming data queue in terms of kernel memory usage.
The "tr", "tm\->when", and "rexmits" fields are not used by RAW.
2005-07-18 15:51:22 +00:00
The "uid"
field holds the effective UID of the creator of the socket.
2004-11-03 13:51:07 +00:00
.\" .TP
.\" .I /proc/net/route
.\" No information, but looks similar to
.\" .BR route (8).
.TP
.I /proc/net/snmp
This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP
2004-11-03 13:51:07 +00:00
management
information bases for an snmp agent.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/net/tcp
Holds a dump of the TCP socket table.
Much of the information is not
of use apart from debugging.
The "sl" value is the kernel hash slot
2007-10-16 19:18:17 +00:00
for the socket, the "local_address" is the local address and port number pair.
The "rem_address" is the remote address and port number pair
2004-11-03 13:51:07 +00:00
(if connected). 'St' is the internal status of the socket.
The 'tx_queue' and 'rx_queue' are the
outgoing and incoming data queue in terms of kernel memory usage.
The "tr", "tm\->when", and "rexmits" fields hold internal information of
2005-07-18 15:51:22 +00:00
the kernel socket state and are only useful for debugging.
The "uid"
field holds the effective UID of the creator of the socket.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/net/udp
Holds a dump of the UDP socket table.
Much of the information is not of
use apart from debugging.
The "sl" value is the kernel hash slot for the
2007-10-16 19:18:17 +00:00
socket, the "local_address" is the local address and port number pair.
The "rem_address" is the remote address and port number pair
2004-11-03 13:51:07 +00:00
(if connected). "St" is the internal status of the socket.
The "tx_queue" and "rx_queue" are the outgoing and incoming data queue
in terms of kernel memory usage.
The "tr", "tm\->when", and "rexmits" fields
are not used by UDP.
2005-07-18 15:51:22 +00:00
The "uid"
field holds the effective UID of the creator of the socket.
2004-11-03 13:51:07 +00:00
The format is:
.nf
.ft CW
.in 1n
sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid
2004-11-03 13:51:07 +00:00
1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0
1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0
1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0
.in
.ft
.fi
.TP
.I /proc/net/unix
Lists the UNIX domain sockets present within the system and their
status.
The format is:
2004-11-03 13:51:07 +00:00
.nf
.sp .5
.ft CW
Num RefCount Protocol Flags Type St Path
0: 00000002 00000000 00000000 0001 03
1: 00000001 00000000 00010000 0001 01 /dev/printer
.ft
.sp .5
.fi
Here 'Num' is the kernel table slot number, 'RefCount' is the number
of users of the socket, 'Protocol' is currently always 0, 'Flags'
represent the internal kernel flags holding the status of the
socket.
Currently, type is always '1' (Unix domain datagram sockets are
2004-11-03 13:51:07 +00:00
not yet supported in the kernel). 'St' is the internal state of the
socket and Path is the bound path (if any) of the socket.
.TP
.I /proc/partitions
Contains major and minor numbers of each partition as well as number
of blocks and partition name.
.TP
.I /proc/pci
This is a listing of all PCI devices found during kernel initialization
and their configuration.
2007-10-03 20:16:58 +00:00
This file has been deprecated in favor of a new /proc
interface for PCI
.RI ( /proc/bus/pci ).
It became optional in Linux 2.2 (available with
.B CONFIG_PCI_OLD_PROC
set at kernel compilation).
It became once more non-optionally enabled in Linux 2.4.
Next, it was deprecated in Linux 2.6 (still available with
.B CONFIG_PCI_LEGACY_PROC
set), and finally removed altogether since Linux 2.6.17.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/scsi
2007-10-03 20:16:58 +00:00
A directory with the scsi mid-level pseudo-file and various SCSI low-level
driver directories,
which contain a file for each SCSI host in this system, all of
which give the status of some part of the SCSI IO subsystem.
These files contain ASCII structures and are, therefore, readable with
2007-10-03 20:16:58 +00:00
.BR cat (1).
2004-11-03 13:51:07 +00:00
You can also write to some of the files to reconfigure the subsystem or
2004-11-03 13:51:07 +00:00
switch
certain features on or off.
.TP
.I /proc/scsi/scsi
This is a listing of all SCSI devices known to the kernel.
The listing is
2004-11-03 13:51:07 +00:00
similar to the one seen during bootup.
scsi currently supports only the \fIadd-single-device\fP command which
2004-11-03 13:51:07 +00:00
allows
root to add a hotplugged device to the list of known devices.
An
.B echo 'scsi add-single-device 1 0 5 0' > /proc/scsi/scsi
will cause
host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0.
If there
2004-11-03 13:51:07 +00:00
is already a device known on this address or the address is invalid, an
error will be returned.
.TP
.I /proc/scsi/[drivername]
\fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740,
aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic,
scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000.
These directories show up for all drivers that registered at least one
SCSI
HBA.
Every directory contains one file per registered host.
Every
2004-11-03 13:51:07 +00:00
host-file is named after the number the host was assigned during
initialization.
2004-11-03 13:51:07 +00:00
Reading these files will usually show driver and host configuration,
2004-11-03 13:51:07 +00:00
statistics etc.
Writing to these files allows different things on different hosts.
For example, with the \fIlatency\fP and \fInolatency\fP commands,
root can switch on and off command latency measurement code in the
eata_dma driver.
With the \fIlockup\fP and \fIunlock\fP commands,
root can control bus lockups simulated by the scsi_debug driver.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/self
This directory refers to the process accessing the /proc filesystem,
and is identical to the /proc directory named by the process ID of the
same process.
.TP
.I /proc/slabinfo
Information about kernel caches.
2007-11-23 18:45:54 +00:00
Since Linux 2.6.16 this file is only present if the
.B CONFIG_SLAB
kernel configuration option is enabled.
The columns in
.I /proc/slabinfo
are:
.in +4n
2004-11-03 13:51:07 +00:00
.nf
2004-11-03 13:51:07 +00:00
cache-name
num-active-objs
total-objs
object-size
num-active-slabs
total-slabs
num-pages-per-slab
.fi
.in
See
2004-11-03 13:51:07 +00:00
.BR slabinfo (5)
for details.
.TP
.I /proc/stat
kernel/system statistics.
Varies with architecture.
Common
2004-11-03 13:51:07 +00:00
entries include:
.RS
.TP
\fIcpu 3357 0 4313 1362393\fP
2005-06-28 14:19:06 +00:00
The amount of time, measured in units of
USER_HZ (1/100ths of a second on most architectures),
2005-06-28 14:19:06 +00:00
that the system spent in user mode,
user mode with low priority (nice), system mode, and the
idle task, respectively.
2007-10-15 17:52:31 +00:00
.\" FIXME Actually, the following info about the /proc/stat 'cpu' field
2006-03-20 04:46:28 +00:00
.\" does not seem to be quite right (at least in 2.6.12)
2005-06-28 14:19:06 +00:00
The last value should be USER_HZ times the
2004-11-03 13:51:07 +00:00
second entry in the uptime pseudo-file.
2005-06-28 14:19:06 +00:00
.sp
In Linux 2.6 this line includes three additional columns:
.I iowait
\- time waiting for I/O to complete (since 2.5.41);
.I irq
\- time servicing interrupts (since 2.6.0-test4);
.I softirq
\- time servicing softirqs (since 2.6.0-test4).
.sp
Since Linux 2.6.11, there is an eighth column,
.I steal
\- stolen time, which is the time spent in other operating systems when
running in a virtualized environment
2004-11-03 13:51:07 +00:00
.TP
\fIpage 5741 1808\fP
The number of pages the system paged in and the number that were paged
out (from disk).
.TP
\fIswap 1 0\fP
The number of swap pages that have been brought in and out.
.TP
.\" FIXME The following is not the full picture for the 'intr' of
2006-03-20 04:46:28 +00:00
.\" /proc/stat on 2.6:
2004-11-03 13:51:07 +00:00
\fIintr 1462898\fP
2005-06-28 14:19:06 +00:00
This line shows counts of interrupts serviced since boot time,
for each of the possible system interrupts.
The first column is the total of all interrupts serviced;
each subsequent column is the total for a particular interrupt.
2004-11-03 13:51:07 +00:00
.TP
\fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP...
(major,minor):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written)
2005-06-28 14:19:06 +00:00
.br
(Linux 2.4 only)
2004-11-03 13:51:07 +00:00
.TP
\fIctxt 115315\fP
The number of context switches that the system underwent.
.TP
\fIbtime 769041601\fP
2007-12-18 15:37:46 +00:00
boot time, in seconds since the Epoch (January 1, 1970).
2004-11-03 13:51:07 +00:00
.TP
\fIprocesses 86031\fP
Number of forks since boot.
2005-06-28 14:19:06 +00:00
.TP
\fIprocs_running 6\fP
Number of processes in runnable state.
(Linux 2.5.45 onwards.)
.TP
\fIprocs_blocked 2\fP
Number of processes blocked waiting for I/O to complete.
(Linux 2.5.45 onwards.)
2004-11-03 13:51:07 +00:00
.RE
.TP
.I /proc/swaps
Swap areas in use.
See also
2004-11-03 13:51:07 +00:00
.BR swapon (8).
.TP
.I /proc/sys
This directory (present since 1.3.57) contains a number of files
and subdirectories corresponding to kernel variables.
These variables can be read and sometimes modified using
the \fIproc\fP file system, and the
.BR sysctl (2)
system call.
Presently, there are subdirectories
2004-11-03 13:51:07 +00:00
.IR abi ", " debug ", " dev ", " fs ", " kernel ", " net ", " proc ", "
.IR rxrpc ", " sunrpc " and " vm
that each contain more files and subdirectories.
.TP
.IR /proc/sys/abi " (since Linux 2.4.10)"
2004-11-03 13:51:07 +00:00
This directory may contain files with application binary information.
.\" On some systems, it is not present.
See the kernel source file
.I Documentation/sysctl/abi.txt
for more information.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/sys/debug
This directory may be empty.
.TP
.I /proc/sys/dev
2007-12-25 20:50:22 +00:00
This directory contains device-specific information (e.g.,
2007-10-03 19:48:21 +00:00
.IR dev/cdrom/info ).
2004-11-03 13:51:07 +00:00
On
some systems, it may be empty.
.TP
.I /proc/sys/fs
This contains the subdirectories
.IR binfmt_misc ", " inotify ", and " mqueue ,
2004-11-03 13:51:07 +00:00
and files
.IR dentry-state ", " dir-notify-enable ", " dquot-nr ", " file-max ", "
.IR file-nr ", " inode-max ", " inode-nr ", " inode-state ", "
.IR lease-break-time ", " leases-enable ", "
.IR overflowgid ", " overflowuid ", "
.IR suid_dumpable ", "
.IR super-max ", and " super-nr .
2004-11-03 13:51:07 +00:00
.TP
.I /proc/sys/fs/binfmt_misc
Documentation for files in this directory can be found
in the kernel sources in
2004-11-03 13:51:07 +00:00
.IR Documentation/binfmt_misc.txt .
.TP
.I /proc/sys/fs/dentry-state
This file contains six numbers,
.IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), "
2004-11-03 13:51:07 +00:00
want_pages
(pages requested by system) and two dummy values.
nr_dentry seems to be 0 all the time.
nr_unused seems to be the number of unused dentries.
age_limit is the age in seconds after which dcache entries
can be reclaimed when memory is short and want_pages is
2007-12-25 22:02:19 +00:00
nonzero when the kernel has called shrink_dcache_pages() and the
2004-11-03 13:51:07 +00:00
dcache isn't pruned yet.
.TP
.I /proc/sys/fs/dir-notify-enable
This file can be used to disable or enable the
.I dnotify
interface described in
.BR fcntl (2)
on a system-wide basis.
A value of 0 in this file disables the interface,
and a value of 1 enables it.
.TP
.I /proc/sys/fs/dquot-max
This file shows the maximum number of cached disk quota entries.
On some (2.4) systems, it is not present.
If the number of free cached disk quota entries is very low and
you have some awesome number of simultaneous system users,
you might want to raise the limit.
.TP
.I /proc/sys/fs/dquot-nr
This file shows the number of allocated disk quota
entries and the number of free disk quota entries.
.TP
.I /proc/sys/fs/file-max
This file defines
a system-wide limit on the number of open files for all processes.
(See also
.BR setrlimit (2),
which can be used by a process to set the per-process limit,
.BR RLIMIT_NOFILE ,
on the number of files it may open.)
If you get lots
of error messages about running out of file handles,
try increasing this value:
.br
.br
.nf
.ft CW
echo 100000 > /proc/sys/fs/file-max
.fi
.ft
The kernel constant
2007-06-20 22:20:03 +00:00
.B NR_OPEN
2004-11-03 13:51:07 +00:00
imposes an upper limit on the value that may be placed in
.IR file-max .
If you increase
2004-11-03 13:51:07 +00:00
.IR /proc/sys/fs/file-max ","
be sure to increase
.I /proc/sys/fs/inode-max
to 3-4 times the new
value of
2004-11-03 13:51:07 +00:00
.IR /proc/sys/fs/file-max ","
or you will run out of inodes.
.TP
.I /proc/sys/fs/file-nr
This (read-only) file
gives the number of files presently opened.
It contains three numbers: The number of allocated
file handles, the number of free file handles and the maximum
number of file handles.
The kernel allocates file handles dynamically, but it
doesn't free them again.
If the number of allocated files is close to the
2004-11-03 13:51:07 +00:00
maximum, you should consider increasing the maximum.
When the number of free file handles is
large, you've encountered a peak in your usage of file
handles and you probably don't need to increase the maximum.
.TP
.I /proc/sys/fs/inode-max
2004-11-03 13:51:07 +00:00
This file contains the maximum number of in-memory inodes.
On some (2.4) systems, it may not be
present.
This value should be 3-4 times larger
2007-06-17 14:12:43 +00:00
than the value in file-max, since \fIstdin\fP, \fIstdout\fP
and network sockets also
need an inode to handle them.
When you regularly run
2004-11-03 13:51:07 +00:00
out of inodes, you need to increase this value.
.TP
.I /proc/sys/fs/inode-nr
This file contains the first two values from inode-state.
.TP
.I /proc/sys/fs/inode-state
This file
contains seven numbers: nr_inodes, nr_free_inodes, preshrink and four
dummy values.
nr_inodes is the number of inodes the system has allocated.
This can be slightly more than inode-max because
2006-01-18 08:18:46 +00:00
Linux allocates them one page full at a time.
2004-11-03 13:51:07 +00:00
nr_free_inodes represents the number of free inodes.
2007-12-25 22:02:19 +00:00
preshrink is nonzero when the nr_inodes > inode-max and the
2004-11-03 13:51:07 +00:00
system needs to prune the inode list instead of allocating
more.
.TP
.IR /proc/sys/fs/inotify " (since Linux 2.6.13)"
This directory contains files
.IR max_queued_events ", " max_user_instances ", and " max_user_watches ,
that can be used to limit the amount of kernel memory consumed by the
.I inotify
interface.
For further details, see
.BR inotify (7).
.TP
2004-11-03 13:51:07 +00:00
.I /proc/sys/fs/lease-break-time
This file
specifies the grace period that the kernel grants to a process
holding a file lease
.RB ( fcntl (2))
after it has sent a signal to that process notifying it
that another process is waiting to open the file.
If the lease holder does not remove or downgrade the lease within
this grace period, the kernel forcibly breaks the lease.
.TP
.I /proc/sys/fs/leases-enable
This file can be used to enable or disable file leases
.RB ( fcntl (2))
on a system-wide basis.
If this file contains the value 0, leases are disabled.
2007-12-25 22:02:19 +00:00
A nonzero value enables leases.
.TP
.IR /proc/sys/fs/mqueue " (since Linux 2.6.6)"
This directory contains files
.IR msg_max ", " msgsize_max ", and " queues_max ,
controlling the resources used by POSIX message queues.
See
.BR mq_overview (7)
for details.
.TP
.IR /proc/sys/fs/overflowgid " and " /proc/sys/fs/overflowuid
These files
allow you to change the value of the fixed UID and GID.
The default is 65534.
Some filesystems only support 16-bit UIDs and GIDs, although in Linux
UIDs and GIDs are 32 bits.
When one of these filesystems is mounted
with writes enabled, any UID or GID that would exceed 65535 is translated
to the overflow value before being written to disk.
.TP
.IR /proc/sys/fs/suid_dumpable " (since Linux 2.6.13)"
.\" The following is based on text from Documentation/sysctl/kernel.txt
The value in this file determines whether core dump files are
produced for set-user-ID or otherwise protected/tainted binaries.
Three different integer values can be specified:
.sp
\fI0\ (default)\fP
This provides the traditional (pre-Linux 2.6.13) behavior.
A core dump will not be produced for a process which has
changed credentials (by calling
.BR seteuid (2),
.BR setgid (2),
or similar, or by executing a set-user-ID or set-group-ID program)
or whose binary does not have read permission enabled.
.sp
\fI1\ ("debug")\fP
All processes dump core when possible.
The core dump is owned by the file system user ID of the dumping process
and no security is applied.
This is intended for system debugging situations only.
Ptrace is unchecked.
.sp
\fI2\ ("suidsafe")\fP
Any binary which normally would not be dumped (see "0" above)
is dumped readable by root only.
This allows the user to remove the core dump file but not to read it.
For security reasons core dumps in this mode will not overwrite one
another or other files.
This mode is appropriate when administrators are
attempting to debug problems in a normal environment.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/sys/fs/super-max
This file
2004-11-03 13:51:07 +00:00
controls the maximum number of superblocks, and
thus the maximum number of mounted filesystems the kernel
can have.
You only need to increase super-max if you need to
2004-11-03 13:51:07 +00:00
mount more filesystems than the current value in super-max
allows you to.
.TP
.I /proc/sys/fs/super-nr
This file
2004-11-03 13:51:07 +00:00
contains the number of filesystems currently mounted.
.TP
.I /proc/sys/kernel
This directory contains files
.IR acct ", " cad_pid ", " cap-bound ", "
.IR core_pattern ", " core_uses_pid ", "
.IR ctrl-alt-del ", " dentry-state ", " domainname ", "
.IR hotplug ", " hostname ", "
2004-11-03 13:51:07 +00:00
.IR htab-reclaim " (PowerPC only), "
.IR java-appletviewer " (binfmt_java, obsolete), "
.IR java-interpreter " (binfmt_java, obsolete), " l2cr " (PowerPC only), "
.IR modprobe ", " msgmax ", " msgmnb ", "
2004-11-03 13:51:07 +00:00
.IR msgmni ", " osrelease ", " ostype ", " overflowgid ", " overflowuid ,
.IR panic ", " panic_on_oops ", " pid_max ", "
.IR powersave-nap " (PowerPC only), " printk ", " pty ", " random ", "
.IR real-root-dev ", " reboot-cmd " (SPARC only), " rtsig-max ", "
2004-11-03 13:51:07 +00:00
.IR rtsig-nr ", " sem ", " sg-big-buff ", "
.IR shmall ", " shmmax ", " shmmni ", " sysrq ", " tainted ", " threads-max ,
.IR version ", and " zero-paged " (PowerPC only)."
2004-11-03 13:51:07 +00:00
.TP
.I /proc/sys/kernel/acct
This file
2004-11-03 13:51:07 +00:00
contains three numbers: highwater, lowwater and frequency.
If BSD-style process accounting is enabled these values control
its behavior.
If free space on filesystem where the log lives
goes below lowwater percent accounting suspends.
If free space gets
above highwater percent accounting resumes.
Frequency determines
2004-11-03 13:51:07 +00:00
how often the kernel checks the amount of free space (value is in
seconds).
Default values are 4, 2 and 30.
2004-11-03 13:51:07 +00:00
That is, suspend accounting if <= 2% of space is free; resume it
if >= 4% of space is free; consider information about amount of free space
valid for 30 seconds.
.TP
.I /proc/sys/kernel/cap-bound
This file holds the value of the kernel
2007-09-20 16:26:31 +00:00
.I "capability bounding set"
2004-11-03 13:51:07 +00:00
(expressed as a signed decimal number).
This set is ANDed against the capabilities permitted to a process
during
.BR execve (2).
2004-11-03 13:51:07 +00:00
.TP
.I /proc/sys/kernel/core_pattern
See
.BR core (5).
2007-10-04 06:42:15 +00:00
.TP
2004-11-03 13:51:07 +00:00
.I /proc/sys/kernel/core_uses_pid
See
.BR core (5).
2004-11-03 13:51:07 +00:00
.TP
.I /proc/sys/kernel/ctrl-alt-del
This file
controls the handling of Ctrl-Alt-Del from the keyboard.
When the value in this file is 0, Ctrl-Alt-Del is trapped and
sent to the
.BR init (8)
2004-11-03 13:51:07 +00:00
program to handle a graceful restart.
When the value is > 0, Linux's reaction to a Vulcan
Nerve Pinch (tm) will be an immediate reboot, without even
syncing its dirty buffers.
Note: when a program (like dosemu) has the keyboard in 'raw'
mode, the ctrl-alt-del is intercepted by the program before it
ever reaches the kernel tty layer, and it's up to the program
to decide what to do with it.
.TP
.I /proc/sys/kernel/hotplug
This file
contains the path for the hotplug policy agent.
2007-11-19 00:53:13 +00:00
The default value in this file is
2007-10-03 19:48:21 +00:00
.IR /sbin/hotplug .
2004-11-03 13:51:07 +00:00
.TP
.IR /proc/sys/kernel/domainname " and " /proc/sys/kernel/hostname
can be used to set the NIS/YP domainname and the
hostname of your box in exactly the same way as the commands
2007-06-08 12:25:56 +00:00
.BR domainname (1)
and
2007-08-27 10:11:23 +00:00
.BR hostname (1),
that is:
2004-11-03 13:51:07 +00:00
.in +4n
.nf
2004-11-03 13:51:07 +00:00
# echo "darkstar" > /proc/sys/kernel/hostname
# echo "mydomain" > /proc/sys/kernel/domainname
.fi
.in
2004-11-03 13:51:07 +00:00
has the same effect as
.in +4n
.nf
2004-11-03 13:51:07 +00:00
# hostname "darkstar"
# domainname "mydomain"
.fi
.in
2004-11-03 13:51:07 +00:00
Note, however, that the classic darkstar.frop.org has the
hostname "darkstar" and DNS (Internet Domain Name Server)
domainname "frop.org", not to be confused with the NIS (Network
Information Service) or YP (Yellow Pages) domainname.
These two
domain names are in general different.
For a detailed discussion
2004-11-03 13:51:07 +00:00
see the
.BR hostname (1)
man page.
.TP
.I /proc/sys/kernel/htab-reclaim
2007-12-25 22:02:19 +00:00
(PowerPC only) If this file is set to a nonzero value,
2004-11-03 13:51:07 +00:00
the PowerPC htab
2007-10-03 19:48:21 +00:00
(see kernel file
.IR Documentation/powerpc/ppc_htab.txt )
is pruned
2004-11-03 13:51:07 +00:00
each time the system hits the idle loop.
.TP
.I /proc/sys/kernel/l2cr
(PowerPC only) This file
contains a flag that controls the L2 cache of G3 processor
boards.
If 0, the cache is disabled.
2007-12-25 22:02:19 +00:00
Enabled if nonzero.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/sys/kernel/modprobe
This file contains the path for the kernel module loader.
The default value is
.IR /sbin/modprobe .
The file is only present if the kernel is built with the
2007-11-23 18:45:54 +00:00
.B CONFIG_KMOD
option enabled.
It is described by the kernel source file
.I Documentation/kmod.txt
(only present in kernel 2.4 and earlier).
2004-11-03 13:51:07 +00:00
.TP
.I /proc/sys/kernel/msgmax
This file defines
a system-wide limit specifying the maximum number of bytes in
a single message written on a System V message queue.
.TP
.I /proc/sys/kernel/msgmni
This file defines the system-wide limit on the number of
message queue identifiers.
(This file is only present in Linux 2.4 onwards.)
.TP
.I /proc/sys/kernel/msgmnb
This file defines a system-wide parameter used to initialize the
2004-11-03 13:51:07 +00:00
.I msg_qbytes
setting for subsequently created message queues.
2004-11-03 13:51:07 +00:00
The
.I msg_qbytes
setting specifies the maximum number of bytes that may be written to the
message queue.
.TP
.IR /proc/sys/kernel/ostype " and " /proc/sys/kernel/osrelease
These files
give substrings of
.IR /proc/version .
.TP
.IR /proc/sys/kernel/overflowgid " and " /proc/sys/kernel/overflowuid
These files duplicate the files
.I /proc/sys/fs/overflowgid
and
.IR /proc/sys/fs/overflowuid .
.TP
.I /proc/sys/kernel/panic
gives read/write access to the kernel variable
.IR panic_timeout .
2007-12-25 22:02:19 +00:00
If this is zero, the kernel will loop on a panic; if nonzero
2004-11-03 13:51:07 +00:00
it indicates that the kernel should autoreboot after this number
of seconds.
When you use the
2004-11-03 13:51:07 +00:00
software watchdog device driver, the recommended setting is 60.
.TP
.I /proc/sys/kernel/panic_on_oops
This file (new in Linux 2.5) controls the kernel's behavior when an oops
or BUG is encountered.
If this file contains 0, then the system
tries to continue operation.
If it contains 1, then the system
2004-11-03 13:51:07 +00:00
delays a few seconds (to give klogd time to record the oops output)
and then panics.
2004-11-03 13:51:07 +00:00
If the
.I /proc/sys/kernel/panic
2007-12-25 22:02:19 +00:00
file is also nonzero then the machine will be rebooted.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/sys/kernel/pid_max
This file
2004-11-03 13:51:07 +00:00
(new in Linux 2.5)
specifies the value at which PIDs wrap around
(i.e., the value in this file is one greater than the maximum PID).
The default value for this file, 32768,
results in the same range of PIDs as on earlier kernels.
On 32-bit platforms, 32768 is the maximum value for
.IR pid_max .
On 64-bit systems,
.I pid_max
can be set to any value up to 2^22
2007-12-16 13:42:51 +00:00
.RB ( PID_MAX_LIMIT ,
approximately 4 million).
.\" Prior to 2.6.10, pid_max could also be raised above 32768 on 32-bit
.\" platforms, but this broke /proc/PID
.\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=109513010926152&w=2
2004-11-03 13:51:07 +00:00
.TP
.IR /proc/sys/kernel/powersave-nap " (PowerPC only)"
This file contains a flag.
If set, Linux-PPC will use the 'nap' mode of
2004-11-03 13:51:07 +00:00
powersaving,
otherwise the 'doze' mode will be used.
.TP
.I /proc/sys/kernel/printk
The four values in this file
are console_loglevel, default_message_loglevel, minimum_console_level and
default_console_loglevel.
These values influence printk() behavior when printing or
logging error messages.
See
2004-11-03 13:51:07 +00:00
.BR syslog (2)
for more info on the different loglevels.
Messages with a higher priority than
console_loglevel will be printed to the console.
Messages without an explicit priority
will be printed with priority default_message_level.
minimum_console_loglevel is the minimum (highest) value to which
console_loglevel can be set.
default_console_loglevel is the default value for console_loglevel.
.TP
.IR /proc/sys/kernel/pty " (since Linux 2.6.4)"
This directory
2004-11-03 13:51:07 +00:00
contains two files relating to the number of Unix 98
pseudo-terminals (see
.BR pts (4))
on the system.
.TP
.I /proc/sys/kernel/pty/max
This file defines the maximum number of pseudo-terminals.
.TP
.I /proc/sys/kernel/pty/nr
This read-only file
indicates how many pseudo-terminals are currently in use.
.TP
.I /proc/sys/kernel/random
This directory
contains various parameters controlling the operation of the file
.IR /dev/random .
See
.BR random (4)
for further information.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/sys/kernel/real-root-dev
This file
2007-10-03 19:48:21 +00:00
is documented in the kernel source file
.IR Documentation/initrd.txt .
2004-11-03 13:51:07 +00:00
.TP
.IR /proc/sys/kernel/reboot-cmd " (Sparc only) "
This file seems to be a way to give an argument to the SPARC
ROM/Flash boot loader.
Maybe to tell it what to do after
2004-11-03 13:51:07 +00:00
rebooting?
.TP
.I /proc/sys/kernel/rtsig-max
(Only in kernels up to and including 2.6.7; see
.BR setrlimit (2))
2004-11-03 13:51:07 +00:00
This file can be used to tune the maximum number
of POSIX realtime (queued) signals that can be outstanding
in the system.
.TP
.I /proc/sys/kernel/rtsig-nr
(Only in kernels up to and including 2.6.7.)
2004-11-03 13:51:07 +00:00
This file shows the number POSIX realtime signals currently queued.
.TP
.IR /proc/sys/kernel/sem " (since Linux 2.4)"
This file contains 4 numbers defining limits for System V IPC semaphores.
These fields are, in order:
2004-11-03 13:51:07 +00:00
.RS
.IP SEMMSL 8
The maximum semaphores per semaphore set.
.IP SEMMNS 8
A system-wide limit on the number of semaphores in all semaphore sets.
.IP SEMOPM 8
The maximum number of operations that may be specified in a
.BR semop (2)
call.
.IP SEMMNI 8
A system-wide limit on the maximum number of semaphore identifiers.
.RE
.TP
.I /proc/sys/kernel/sg-big-buff
This file
2004-11-03 13:51:07 +00:00
shows the size of the generic SCSI device (sg) buffer.
2007-12-09 08:05:43 +00:00
You can't tune it just yet, but you could change it at
2007-10-03 19:48:21 +00:00
compile time by editing
.I include/scsi/sg.h
and changing
2007-12-16 13:42:51 +00:00
the value of
.BR SG_BIG_BUFF .
However, there shouldn't be any reason to change this value.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/sys/kernel/shmall
This file
contains the system-wide limit on the total number of pages of
System V shared memory.
.TP
.I /proc/sys/kernel/shmmax
This file
can be used to query and set the run time limit
on the maximum (System V IPC) shared memory segment size that can be
2004-11-03 13:51:07 +00:00
created.
2007-12-16 13:42:51 +00:00
Shared memory segments up to 1GB are now supported in the
kernel.
2007-12-16 13:42:51 +00:00
This value defaults to
.BR SHMMAX .
2004-11-03 13:51:07 +00:00
.TP
.I /proc/sys/kernel/shmmni
(available in Linux 2.4 and onwards)
This file
specifies the system-wide maximum number of System V shared memory
segments that can be created.
.TP
.I /proc/sys/kernel/version
contains a string like:
2007-12-10 14:33:38 +00:00
#5 Wed Feb 25 21:49:24 MET 1998
2004-11-03 13:51:07 +00:00
The '#5' means that
this is the fifth kernel built from this source base and the
date behind it indicates the time the kernel was built.
.TP
.IR /proc/sys/kernel/zero-paged " (PowerPC only) "
This file
contains a flag.
2007-12-25 22:02:19 +00:00
When enabled (nonzero), Linux-PPC will pre-zero pages in
2004-11-03 13:51:07 +00:00
the idle loop, possibly speeding up get_free_pages.
.TP
.I /proc/sys/net
This directory contains networking stuff.
Explanations for some of the files under this directory can be found in
.BR tcp (7)
and
.BR ip (7).
2004-11-03 13:51:07 +00:00
.TP
.I /proc/sys/net/core/somaxconn
This file defines a ceiling value for the
.I backlog
argument of
.BR listen (2);
see the
.BR listen (2)
manual page for details.
.TP
2004-11-03 13:51:07 +00:00
.I /proc/sys/proc
This directory may be empty.
.TP
.I /proc/sys/sunrpc
This directory supports Sun remote procedure call for network file system
(NFS).
On some systems, it is not present.
2004-11-03 13:51:07 +00:00
.TP
.I /proc/sys/vm
This directory contains files for memory management tuning, buffer and
2004-11-03 13:51:07 +00:00
cache
management.
.TP
.IR /proc/sys/vm/drop_caches " (since Linux 2.6.16)"
Writing to this file causes the kernel to drop clean caches, dentries and
inodes from memory, causing that memory to become free.
To free pagecache, use
.IR "echo 1 > /proc/sys/vm/drop_caches" ;
to free dentries and inodes, use
.IR "echo 2 > /proc/sys/vm/drop_caches" ;
to free pagecache, dentries and inodes, use
.IR "echo 3 > /proc/sys/vm/drop_caches" .
Because this is a non-destructive operation and dirty objects
are not freeable, the
user should run
.BR sync (8)
first.
.TP
2005-09-22 14:49:44 +00:00
.IR /proc/sys/vm/legacy_va_layout " (since Linux 2.6.9)"
.\" The following is from Documentation/filesystems/proc.txt
2007-12-25 22:02:19 +00:00
If nonzero, this disable the new 32-bit memory-mapping layout;
2005-09-22 14:49:44 +00:00
the kernel will use the legacy (2.4) layout for all processes.
.TP
2004-11-03 13:51:07 +00:00
.I /proc/sys/vm/overcommit_memory
This file contains the kernel virtual memory accounting mode.
Values are:
2004-11-03 13:51:07 +00:00
.br
0: heuristic overcommit (this is the default)
.br
1: always overcommit, never check
.br
2: always check, never overcommit
.br
In mode 0, calls of
.BR mmap (2)
2007-06-22 20:40:07 +00:00
with
2007-09-20 16:26:31 +00:00
.B MAP_NORESERVE
2007-06-22 20:40:07 +00:00
set are not checked, and the default check is very weak,
2004-11-03 13:51:07 +00:00
leading to the risk of getting a process "OOM-killed".
2007-12-25 22:02:19 +00:00
Under Linux 2.4 any nonzero value implies mode 1.
2004-11-03 13:51:07 +00:00
In mode 2 (available since Linux 2.6), the total virtual address space
on the system is limited to (SS + RAM*(r/100)),
where SS is the size of the swap space, and RAM
is the size of the physical memory, and r is the contents of the file
.IR /proc/sys/vm/overcommit_ratio .
.TP
.I /proc/sys/vm/overcommit_ratio
See the description of
2004-11-03 13:51:07 +00:00
.IR /proc/sys/vm/overcommit_memory .
.TP
.I /proc/sysvipc
Subdirectory containing the pseudo-files
2004-11-03 13:51:07 +00:00
.IR msg ", " sem " and " shm "."
These files list the System V Interprocess Communication (IPC) objects
2004-11-03 13:51:07 +00:00
(respectively: message queues, semaphores, and shared memory)
that currently exist on the system,
providing similar information to that available via
.BR ipcs (1).
These files have headers and are formatted (one IPC object per line)
for easy understanding.
2006-04-21 03:53:43 +00:00
.BR svipc (7)
2004-11-03 13:51:07 +00:00
provides further background on the information shown by these files.
.TP
.I /proc/tty
Subdirectory containing the pseudo-files and subdirectories for
2004-11-03 13:51:07 +00:00
tty drivers and line disciplines.
.TP
.I /proc/uptime
This file contains two numbers: the uptime of the system (seconds),
and the amount of time spent in idle process (seconds).
.TP
.I /proc/version
This string identifies the kernel version that is currently running.
It includes the contents of
.IR /proc/sys/kernel/ostype ,
2007-09-20 16:26:31 +00:00
.I /proc/sys/kernel/osrelease
and
.IR /proc/sys/kernel/version .
For example:
2004-11-03 13:51:07 +00:00
.nf
.in -2
.ft CW
Linux version 1.0.9 (quinlan@phaze) #1 Sat May 14 01:51:54 EDT 1994
.ft
.in +2
.fi
.TP
.IR /proc/vmstat " (since Linux 2.6)"
This file displays various virtual memory statistics.
.TP
.IR /proc/zoneinfo " (since Linux 2.6.13)"
This file display information about memory zones.
This is useful for analyzing virtual memory behavior.
2006-03-23 02:13:08 +00:00
.\" FIXME more should be said about /proc/zoneinfo
2007-05-16 18:25:50 +00:00
.SH NOTES
Many strings (i.e., the environment and command line) are in
the internal format, with sub-fields terminated by null bytes ('\\0'),
so you
may find that things are more readable if you use \fIod \-c\fP or \fItr
"\\000" "\\n"\fP to read them.
Alternatively, \fIecho `cat <file>`\fP works well.
This manual page is incomplete, possibly inaccurate, and is the kind
of thing that needs to be updated very often.
.\" .SH ACKNOWLEDGEMENTS
.\" The material on /proc/sys/fs and /proc/sys/kernel is closely based on
.\" kernel source documentation files written by Rik van Riel.
2004-11-03 13:51:07 +00:00
.SH "SEE ALSO"
.BR cat (1),
.BR find (1),
.BR free (1),
.BR ps (1),
.BR tr (1),
.BR uptime (1),
.BR chroot (2),
.BR mmap (2),
.BR readlink (2),
.BR syslog (2),
.BR slabinfo (5),
.BR hier (7),
.BR arp (8),
.BR dmesg (8),
.BR hdparm (8),
.BR ifconfig (8),
.BR init (8),
.BR lsmod (8),
.BR lspci (8),
.BR mount (8),
2004-11-03 13:51:07 +00:00
.BR netstat (8),
.BR procinfo (8),
.BR route (8)
.br
.I /usr/src/linux/Documentation/filesystems/proc.txt