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