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