]>
Commit | Line | Data |
---|---|---|
fea681da | 1 | .\" Copyright (C) 1994, 1995 by Daniel Quinlan (quinlan@yggdrasil.com) |
b4e9ee8f | 2 | .\" and Copyright (C) 2002-2008 Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da MK |
3 | .\" with networking additions from Alan Cox (A.Cox@swansea.ac.uk) |
4 | .\" and scsi additions from Michael Neuffer (neuffer@mail.uni-mainz.de) | |
5 | .\" and sysctl additions from Andries Brouwer (aeb@cwi.nl) | |
6 | .\" and System V IPC (as well as various other) additions from | |
c11b1abf | 7 | .\" Michael Kerrisk <mtk.manpages@gmail.com> |
fea681da MK |
8 | .\" |
9 | .\" This is free documentation; you can redistribute it and/or | |
10 | .\" modify it under the terms of the GNU General Public License as | |
11 | .\" published by the Free Software Foundation; either version 2 of | |
12 | .\" the License, or (at your option) any later version. | |
13 | .\" | |
14 | .\" The GNU General Public License's references to "object code" | |
15 | .\" and "executables" are to be interpreted as the output of any | |
16 | .\" document formatting or typesetting system, including | |
17 | .\" intermediate and printed output. | |
18 | .\" | |
19 | .\" This manual is distributed in the hope that it will be useful, | |
20 | .\" but WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 | .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | .\" GNU General Public License for more details. | |
23 | .\" | |
24 | .\" You should have received a copy of the GNU General Public | |
25 | .\" License along with this manual; if not, write to the Free | |
26 | .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, | |
27 | .\" USA. | |
28 | .\" | |
29 | .\" Modified 1995-05-17 by faith@cs.unc.edu | |
30 | .\" Minor changes by aeb and Marty Leisner (leisner@sdsp.mc.xerox.com). | |
31 | .\" Modified 1996-04-13, 1996-07-22 by aeb@cwi.nl | |
32 | .\" Modified 2001-12-16 by rwhron@earthlink.net | |
33 | .\" Modified 2002-07-13 by jbelton@shaw.ca | |
34 | .\" Modified 2002-07-22, 2003-05-27, 2004-04-06, 2004-05-25 | |
c11b1abf | 35 | .\" by Michael Kerrisk <mtk.manpages@gmail.com> |
5d6d14a0 MK |
36 | .\" 2004-11-17, mtk -- updated notes on /proc/loadavg |
37 | .\" 2004-12-01, mtk, rtsig-max and rtsig-nr went away in 2.6.8 | |
568105c6 MK |
38 | .\" 2004-12-14, mtk, updated 'statm', and fixed error in order of list |
39 | .\" 2005-05-12, mtk, updated 'stat' | |
6d64ca9c | 40 | .\" 2005-07-13, mtk, added /proc/sys/fs/mqueue/* |
363f747c MK |
41 | .\" 2005-09-16, mtk, Added /proc/sys/fs/suid_dumpable |
42 | .\" 2005-09-19, mtk, added /proc/zoneinfo | |
b4e9ee8f | 43 | .\" 2005-03-01, mtk, moved /proc/sys/fs/mqueue/* material to mq_overview.7. |
16b5f7ba | 44 | .\" 2008-06-05, mtk, Added /proc/PID/oom_score, /proc/PID/oom_adj, |
a1d5601b | 45 | .\" /proc/PID/limits, /proc/PID/mountinfo, /proc/PID/mounstats, |
b4e9ee8f | 46 | .\" and /proc/PID/fdinfo/*. |
16b5f7ba | 47 | .\" 2008-06-19, mtk, Documented /proc/PID/status. |
363f747c | 48 | .\" |
b07b19c4 MK |
49 | .\" FIXME 2.6.14 has /proc/PID/numa_maps (if CONFIG_NUMA is |
50 | .\" enabled); this needs to be documented. | |
c13182ef | 51 | .\" Info on numa_maps can be found in the patch-2.6.14 |
b07b19c4 | 52 | .\" Changelog, but this is possibly not up to date. |
8cf9de1b | 53 | .\" |
c533af9d | 54 | .\" FIXME 2.6.13 seems to have /proc/vmcore implemented |
c13182ef MK |
55 | .\" in the source code, but there is no option available under |
56 | .\" 'make xconfig'; eventually this should be fixed, and then info | |
57 | .\" from the patch-2.6.13 and change log could be used to write an | |
c533af9d | 58 | .\" entry in this man page. |
8cf9de1b | 59 | .\" |
c13182ef MK |
60 | .\" FIXME cross check against Documentation/filesystems/proc.txt |
61 | .\" to see what information could be imported from that file | |
c533af9d | 62 | .\" into this file. |
fea681da | 63 | .\" |
b4e9ee8f | 64 | .TH PROC 5 2008-06-22 "Linux" "Linux Programmer's Manual" |
fea681da | 65 | .SH NAME |
24d01c53 | 66 | proc \- process information pseudo-file system |
fea681da MK |
67 | .SH DESCRIPTION |
68 | The | |
69 | .I proc | |
24d01c53 | 70 | file system is a pseudo-file system which is used as an interface to |
c13182ef MK |
71 | kernel data structures. |
72 | It is commonly mounted at | |
fea681da | 73 | .IR /proc . |
c13182ef | 74 | Most of it is read-only, but some files allow kernel variables to be |
fea681da MK |
75 | changed. |
76 | .LP | |
77 | The following outline gives a quick tour through the /proc hierarchy. | |
78 | .PD 1 | |
79 | .TP | |
80 | .I /proc/[number] | |
81 | There is a numerical subdirectory for each running process; the | |
82 | subdirectory is named by the process ID. | |
83 | Each such subdirectory contains the following | |
84 | pseudo-files and directories. | |
b4e9ee8f MK |
85 | .\" FIXME Describe /proc/[number]/attr and |
86 | .\" /proc/PID/task/TID/attr | |
87 | .\" This is a directory | |
88 | .\" Added in ??? | |
89 | .\" CONFIG_SECURITY | |
90 | .\" | |
fea681da | 91 | .TP |
857f1942 MK |
92 | .IR /proc/[number]/auxv " (since 2.6.0-test7)" |
93 | This contains the contents of the ELF interpreter information passed | |
c13182ef | 94 | to the process at exec time. |
857f1942 | 95 | The format is one \fIunsigned long\fP ID |
c13182ef | 96 | plus one \fIunsigned long\fP value for each entry. |
857f1942 | 97 | The last entry contains two zeros. |
b4e9ee8f MK |
98 | .\" FIXME Describe /proc/[number]/cgroup and |
99 | .\" /proc/PID/task/TID/cgroup | |
100 | .\" Info in Documentation/cgroups.txt | |
101 | .\" Added in 2.6.24 | |
102 | .\" CONFIG_CGROUPS | |
103 | .\" | |
104 | .\" FIXME Describe /proc/[number]/clear_refs | |
105 | .\" Added in 2.6.22 | |
106 | .\" "Clears page referenced bits shown in smaps output" | |
107 | .\" write-only | |
108 | .\" CONFIG_PROC_PAGE_MONITOR | |
857f1942 | 109 | .TP |
fea681da | 110 | .I /proc/[number]/cmdline |
b447cd58 MK |
111 | This holds the complete command line for the process, |
112 | unless the process is a zombie. | |
113 | .\" In 2.3.26, this also used to be true if the process was swapped out. | |
114 | In the latter case, there is nothing in this file: | |
75b94dc3 | 115 | that is, a read on this file will return 0 characters. |
b447cd58 | 116 | The command-line arguments appear in this file as a set of |
fea681da MK |
117 | null-separated strings, with a further null byte after the last string. |
118 | .TP | |
b4e9ee8f MK |
119 | .IR /proc/[number]/coredump_filter " (since kernel 2.6.23)" |
120 | See | |
121 | .BR core (5). | |
28f2c98d MK |
122 | .TP |
123 | .IR /proc/[number]/cpuset " (since kernel 2.6.12)" | |
124 | .\" and/proc/PID/task/TID/cpuset | |
125 | See | |
126 | .BR cpuset (7). | |
b4e9ee8f | 127 | .TP |
fea681da | 128 | .I /proc/[number]/cwd |
c13182ef | 129 | This is a symbolic link to the current working directory of the process. |
afcaf646 | 130 | To find out the cwd of process 20, for instance, you can do this: |
fea681da MK |
131 | |
132 | .br | |
133 | .nf | |
134 | .ft CW | |
135 | cd /proc/20/cwd; /bin/pwd | |
136 | .fi | |
137 | .ft | |
138 | ||
c13182ef MK |
139 | Note that the |
140 | .I pwd | |
e7b489f0 | 141 | command is often a shell built-in, and might |
c13182ef MK |
142 | not work properly. |
143 | In bash, you may use pwd \-P. | |
afcaf646 MK |
144 | |
145 | .\" The following was still true as at kernel 2.6.13 | |
c13182ef MK |
146 | In a multithreaded process, the contents of this symbolic link |
147 | are not available if the main thread has already terminated | |
afcaf646 MK |
148 | (typically by calling |
149 | .BR pthread_exit (3). | |
fea681da MK |
150 | .TP |
151 | .I /proc/[number]/environ | |
152 | This file contains the environment for the process. | |
f81fb444 | 153 | The entries are separated by null bytes (\(aq\\0\(aq), |
b4e9ee8f | 154 | and there may be a null byte at the end. |
fea681da | 155 | Thus, to print out the environment of process 1, you would do: |
a08ea57c | 156 | .in +4n |
fea681da | 157 | .nf |
a08ea57c | 158 | |
fea681da MK |
159 | .ft CW |
160 | (cat /proc/1/environ; echo) | tr "\\000" "\\n" | |
161 | .fi | |
162 | .ft P | |
a08ea57c | 163 | .in |
fea681da MK |
164 | |
165 | (For a reason why one should want to do this, see | |
f41d1d3d MK |
166 | .BR lilo (8) |
167 | or | |
168 | .BR grub (8).) | |
fea681da MK |
169 | .TP |
170 | .I /proc/[number]/exe | |
171 | Under Linux 2.2 and later, this file is a symbolic link | |
2d7195b8 | 172 | containing the actual pathname of the executed command. |
c13182ef MK |
173 | This symbolic link can be dereferenced normally; attempting to open |
174 | it will open the executable. | |
175 | You can even type | |
fea681da | 176 | .I /proc/[number]/exe |
c13182ef | 177 | to run another copy of the same executable as is being run by |
6931a324 | 178 | process [number]. |
afcaf646 | 179 | .\" The following was still true as at kernel 2.6.13 |
c13182ef MK |
180 | In a multithreaded process, the contents of this symbolic link |
181 | are not available if the main thread has already terminated | |
afcaf646 MK |
182 | (typically by calling |
183 | .BR pthread_exit (3)). | |
fea681da MK |
184 | |
185 | Under Linux 2.0 and earlier | |
186 | .I /proc/[number]/exe | |
c13182ef MK |
187 | is a pointer to the binary which was executed, |
188 | and appears as a symbolic link. | |
189 | A | |
fea681da MK |
190 | .BR readlink (2) |
191 | call on this file under Linux 2.0 returns a string in the format: | |
192 | ||
193 | [device]:inode | |
194 | ||
195 | For example, [0301]:1502 would be inode 1502 on device major 03 (IDE, | |
196 | MFM, etc. drives) minor 01 (first partition on the first drive). | |
197 | ||
198 | .BR find (1) | |
4d9b6984 | 199 | with the \-inum option can be used to locate the file. |
fea681da MK |
200 | .TP |
201 | .I /proc/[number]/fd | |
202 | This is a subdirectory containing one entry for each file which the | |
203 | process has open, named by its file descriptor, and which is a | |
c13182ef MK |
204 | symbolic link to the actual file. |
205 | Thus, 0 is standard input, 1 standard output, 2 standard error, etc. | |
fea681da | 206 | |
afcaf646 MK |
207 | .\" The following was still true as at kernel 2.6.13 |
208 | In a multithreaded process, the contents of this directory | |
c13182ef | 209 | are not available if the main thread has already terminated |
afcaf646 MK |
210 | (typically by calling |
211 | .BR pthread_exit (3)). | |
212 | ||
fea681da MK |
213 | Programs that will take a filename, but will not take the standard |
214 | input, and which write to a file, but will not send their output to | |
4d9b6984 MK |
215 | standard output, can be effectively foiled this way, assuming that \-i |
216 | is the flag designating an input file and \-o is the flag designating | |
fea681da | 217 | an output file: |
a08ea57c | 218 | .in +4n |
fea681da MK |
219 | .nf |
220 | ||
2bc2f479 | 221 | \f(CWfoobar \-i /proc/self/fd/0 \-o /proc/self/fd/1 ...\fR |
fea681da | 222 | .fi |
a08ea57c MK |
223 | .in |
224 | ||
fea681da MK |
225 | and you have a working filter. |
226 | .\" The following is not true in my tests (MTK): | |
227 | .\" Note that this will not work for | |
228 | .\" programs that seek on their files, as the files in the fd directory | |
229 | .\" are not seekable. | |
230 | ||
231 | /proc/self/fd/N is approximately the same as /dev/fd/N in some UNIX | |
c13182ef MK |
232 | and UNIX-like systems. |
233 | Most Linux MAKEDEV scripts symbolically link | |
fea681da | 234 | /dev/fd to /proc/self/fd, in fact. |
6aefb6df | 235 | .\" FIXME Describe /proc/[number]/loginuid |
b877b392 | 236 | .\" Added in 2.6.11; updating requires CAP_AUDIT_CONTROL |
b4e9ee8f MK |
237 | .\" CONFIG_AUDITSYSCALL |
238 | .TP | |
239 | .I /proc/[number]/fdinfo/ " (since kernel 2.6.22)" | |
240 | This is a subdirectory containing one entry for each file which the | |
241 | process has open, named by its file descriptor. | |
242 | The contents of each file can be read to obtain information | |
243 | about the corresponding file descriptor, for example: | |
244 | .in +4n | |
245 | .nf | |
246 | ||
247 | $ cat /proc/12015/fdinfo/4 | |
248 | pos: 1000 | |
249 | flags: 01002002 | |
250 | .fi | |
251 | .in | |
252 | ||
253 | The | |
254 | .I pos | |
255 | field is a decimal number showing the current file offset. | |
256 | The | |
257 | .I flags | |
258 | field is an octal number that displays the | |
259 | file access mode and file status flags (see | |
260 | .BR open (2)). | |
261 | ||
262 | The files in this directory are readable only by the owner of the process. | |
263 | .\" FIXME document /proc/[number]/io | |
264 | .\" .TP | |
265 | .\" .IR /proc/[number]/io " (since kernel 2.6.20)" | |
266 | .TP | |
267 | .IR /proc/[number]/limits " (since kernel 2.6.24)" | |
268 | This file displays the soft limit, hard limit, and units of measurement | |
269 | for each of the process's resource limits (see | |
270 | .BR getrlimit (2). | |
271 | The file is protected to only allow reading by the real UID of the process. | |
fea681da MK |
272 | .TP |
273 | .I /proc/[number]/maps | |
274 | A file containing the currently mapped memory regions and their access | |
275 | permissions. | |
276 | ||
277 | The format is: | |
278 | ||
279 | .nf | |
280 | .ft CW | |
281 | .in 8n | |
282 | address perms offset dev inode pathname | |
283 | 08048000-08056000 r-xp 00000000 03:0c 64593 /usr/sbin/gpm | |
284 | 08056000-08058000 rw-p 0000d000 03:0c 64593 /usr/sbin/gpm | |
285 | 08058000-0805b000 rwxp 00000000 00:00 0 | |
286 | 40000000-40013000 r-xp 00000000 03:0c 4165 /lib/ld-2.2.4.so | |
287 | 40013000-40015000 rw-p 00012000 03:0c 4165 /lib/ld-2.2.4.so | |
288 | 4001f000-40135000 r-xp 00000000 03:0c 45494 /lib/libc-2.2.4.so | |
289 | 40135000-4013e000 rw-p 00115000 03:0c 45494 /lib/libc-2.2.4.so | |
290 | 4013e000-40142000 rw-p 00000000 00:00 0 | |
291 | bffff000-c0000000 rwxp 00000000 00:00 0 | |
292 | .ft | |
293 | .fi | |
294 | .in | |
295 | ||
296 | where address is the address space in the process that it occupies, | |
297 | perms is a set of permissions: | |
298 | ||
299 | .nf | |
300 | .in +5 | |
301 | r = read | |
302 | w = write | |
303 | x = execute | |
304 | s = shared | |
305 | p = private (copy on write) | |
306 | .fi | |
307 | .in | |
308 | ||
309 | offset is the offset into the file/whatever, dev is the device | |
310 | (major:minor), and inode is the inode on that device. 0 indicates | |
311 | that no inode is associated with the memory region, as the case would | |
312 | be with bss. | |
313 | ||
314 | Under Linux 2.0 there is no field giving pathname. | |
315 | .TP | |
316 | .I /proc/[number]/mem | |
317 | This file can be used to access the pages of a process's memory through | |
318 | .BR open (2), | |
319 | .BR read (2), | |
320 | and | |
ccb2bb0d | 321 | .BR lseek (2). |
bd4b0ce7 MK |
322 | .\" FIXME Describe /proc/[number]/mountinfo and |
323 | .\" /proc/PID/task/TID/mountinfo | |
324 | .\" Info in Documentation/filesystems/proc.txt | |
325 | .\" Added in 2.6.26 | |
326 | .\" | |
b4e9ee8f MK |
327 | .TP |
328 | .IR /proc/[number]/mountinfo " (since Linux 2.6.26)" | |
329 | .\" This info adapted from Documentation/filesystems/proc.txt | |
330 | This file contains information about mount points. | |
331 | It contains lines of the form: | |
332 | .nf | |
333 | .ft CW | |
334 | .in 8n | |
335 | ||
336 | 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue | |
337 | (1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11) | |
338 | .in | |
339 | .ft | |
340 | .fi | |
341 | .IP | |
342 | The numbers in parentheses are labels for the descriptions below: | |
343 | .RS 12 | |
344 | .TP 5 | |
345 | (1) | |
346 | mount ID: unique identifier of the mount (may be reused after | |
347 | .BR umount (2)). | |
348 | .TP | |
349 | (2) | |
350 | parent ID: ID of parent mount (or of self for the top of the mount tree). | |
351 | .TP | |
352 | (3) | |
353 | major:minor: value of | |
354 | .I st_dev | |
355 | for files on file system (see | |
356 | .BR stat (2)). | |
357 | .TP | |
358 | (4) | |
359 | root: root of the mount within the file system. | |
360 | .TP | |
361 | (5) | |
362 | mount point: mount point relative to the process's root. | |
363 | .TP | |
364 | (6) | |
365 | mount options: per-mount options. | |
366 | .TP | |
367 | (7) | |
368 | optional fields: zero or more fields of the form "tag[:value]". | |
369 | .TP | |
370 | (8) | |
371 | separator: marks the end of the optional fields. | |
372 | .TP | |
373 | (9) | |
374 | file system type: name of file system in the form "type[.subtype]". | |
375 | .TP | |
376 | (10) | |
377 | mount source: file system-specific information or "none". | |
378 | .TP | |
379 | (11) | |
380 | super options: per-super block options. | |
381 | .RE | |
382 | .IP | |
383 | Parsers should ignore all unrecognized optional fields. | |
384 | Currently the possible optional fields are: | |
385 | .RS 12 | |
386 | .TP 18 | |
387 | shared:X | |
388 | mount is shared in peer group X | |
389 | .TP | |
390 | master:X | |
391 | mount is slave to peer group X | |
392 | .TP | |
393 | propagate_from:X | |
394 | mount is slave and receives propagation from peer group X (*) | |
395 | .TP | |
396 | unbindable | |
397 | mount is unbindable | |
398 | .RE | |
399 | .IP | |
400 | (*) X is the closest dominant peer group under the process's root. | |
401 | If X is the immediate master of the mount, | |
402 | or if there is no dominant peer group under the same root, | |
403 | then only the "master:X" field is present | |
404 | and not the "propagate_from:X" field. | |
405 | ||
406 | For more information on mount propagation see: | |
407 | .I Documentation/filesystems/sharedsubtree.txt | |
408 | in the kernel source tree. | |
409 | .TP | |
410 | .IR /proc/[number]/mountstats " (since Linux 2.6.17)" | |
411 | This file system exports information (statistics, configuration information) | |
412 | about the mount points in the process's name space. | |
413 | Lines in this file have the form: | |
414 | .nf | |
415 | ||
416 | device /dev/sda7 mounted on /home with fstype ext3 [statistics] | |
417 | ( 1 ) ( 2 ) (3 ) (4) | |
418 | .fi | |
419 | .IP | |
420 | The fields in each line are: | |
421 | .RS 12 | |
422 | .TP 5 | |
423 | (1) | |
424 | The name of the mounted device | |
425 | (or "nodevice" if there is no corresponding device). | |
426 | .TP | |
427 | (2) | |
428 | The mount point within the file system tree. | |
429 | .TP | |
430 | (3) | |
431 | The file system type. | |
432 | .TP | |
433 | (4) | |
434 | Optional statistics and configuration information. | |
435 | Currently (as at Linux 2.6.26), only NFS file systems export | |
436 | information via this field. | |
437 | .RE | |
438 | .IP | |
439 | This file is only readable by the owner of the process. | |
440 | .\" | |
441 | .\" FIXME Describe /proc/[number]/mountstats and | |
442 | .\" /proc/PID/task/TID/mountstats | |
443 | .\" Some information can be found in the 2.6.17 change log. | |
444 | .\" Added in 2.6.17 | |
445 | .\" | |
446 | .TP | |
447 | .IR /proc/[number]/oom_adj " (since Linux 2.6.11)" | |
448 | .\" FIXME . probably the discussion of MAP_NORESERVE in mmap.2 | |
449 | .\" should point to the discussion of oom_adj and oom_score in this page. | |
450 | This file can be used to adjust the score used to select which process | |
451 | should be killed in an out-of-memory (OOM) situation. | |
452 | The kernel uses this value for a bit-shift operation of the process's | |
453 | .IR oom_score | |
454 | value: | |
455 | valid values are in the range -16 to +15, | |
456 | plus the special value -17, | |
457 | which disables OOM-killing altogether for this process. | |
458 | A positive score increases the likelihood of this | |
459 | process being killed by the OOM-killer; | |
460 | a negative score decreases the likelihood. | |
461 | The default value for this file is 0; | |
462 | a new process inherits its parent's | |
463 | .I oom_adj | |
464 | setting. | |
465 | A process must be privileged | |
466 | .RB ( CAP_SYS_RESOURCE ) | |
467 | to update this file. | |
468 | .TP | |
469 | .IR /proc/[number]/oom_score " (since Linux 2.6.11)" | |
470 | .\" See mm/oom_kill.c::badness() in the 2.6.25 sources | |
471 | This file displays the current score that the kernel gives to | |
472 | this process for the purpose of selecting a process | |
473 | for the OOM-killer. | |
474 | A higher score means that the process is more likely to be | |
475 | selected by the OOM-killer. | |
476 | The basis for this score is the amount of memory used by the process, | |
477 | with increases (+) or decreases (\-) for factors including: | |
478 | .\" See mm/oom_kill.c::badness() in the 2.6.25 sources | |
479 | .RS | |
480 | .IP * 2 | |
481 | whether the process creates a lot of children using | |
482 | .BR fork (2) | |
483 | (+); | |
484 | .IP * | |
485 | whether the process has been running a long time, | |
486 | or has used a lot of CPU time (\-); | |
487 | .IP * | |
488 | whether the process has a low nice value (i.e., > 0) (+); | |
489 | .IP * | |
490 | whether the process is privileged (\-); and | |
491 | .\" More precisely, if it has CAP_SYS_ADMIN or CAP_SYS_RESOURCE | |
492 | .IP * | |
493 | whether the process is making direct hardware access (\-). | |
494 | .\" More precisely, if it has CAP_SYS_RAWIO | |
495 | .RE | |
496 | .IP | |
497 | The | |
498 | .I oom_score | |
499 | also reflects the bit-shift adjustment specified by the | |
500 | .I oom_adj | |
501 | setting for the process. | |
502 | .\" FIXME Describe /proc/[number]/pagemap | |
503 | .\" Added in 2.6.25 | |
504 | .\" CONFIG_PROC_PAGE_MONITOR | |
fea681da MK |
505 | .TP |
506 | .I /proc/[number]/root | |
507 | Unix and Linux support the idea of a per-process root of the | |
24d01c53 | 508 | file system, set by the |
fea681da | 509 | .BR chroot (2) |
c13182ef MK |
510 | system call. |
511 | This file is a symbolic link that points to the process's | |
fea681da | 512 | root directory, and behaves as exe, fd/*, etc. do. |
afcaf646 MK |
513 | |
514 | .\" The following was still true as at kernel 2.6.13 | |
c13182ef MK |
515 | In a multithreaded process, the contents of this symbolic link |
516 | are not available if the main thread has already terminated | |
afcaf646 MK |
517 | (typically by calling |
518 | .BR pthread_exit (3)). | |
6aefb6df MK |
519 | .\" FIXME Describe /proc/[number]/seccomp |
520 | .\" Added in 2.6.12 | |
b4e9ee8f MK |
521 | .\" FIXME Describe /proc/[number]/sessionid |
522 | .\" Added in 2.6.25; read-only; only readable by real UID | |
523 | .\" CONFIG_AUDITSYSCALL | |
524 | .\" FIXME Describe /proc/[number]/sched | |
525 | .\" Added in 2.6.23 | |
526 | .\" CONFIG_SCHED_DEBUG, and additional fields if CONFIG_SCHEDSTATS | |
527 | .\" Displays various scheduling parameters | |
528 | .\" This file can be written, to reset stats | |
529 | .\" FIXME Describe /proc/[number]/schedstats and | |
530 | .\" /proc/[number]/task/TID/schedstats | |
531 | .\" Added in 2.6.9 | |
532 | .\" CONFIG_SCHEDSTATS | |
fea681da | 533 | .TP |
b07b19c4 | 534 | .IR /proc/[number]/smaps " (since Linux 2.6.14)" |
b4e9ee8f | 535 | .\" CONFIG_PROC_PAGE_MONITOR |
b07b19c4 MK |
536 | This file shows memory consumption for each of the process's mappings. |
537 | For each of mappings there is a series of lines as follows: | |
a08ea57c | 538 | .in +4n |
b07b19c4 MK |
539 | .nf |
540 | ||
541 | 08048000-080bc000 r-xp 00000000 03:02 13130 /bin/bash | |
542 | Size: 464 kB | |
543 | Rss: 424 kB | |
544 | Shared_Clean: 424 kB | |
545 | Shared_Dirty: 0 kB | |
546 | Private_Clean: 0 kB | |
547 | Private_Dirty: 0 kB | |
548 | ||
549 | .fi | |
a08ea57c | 550 | .in |
b07b19c4 MK |
551 | The first of these lines shows the same information as is displayed |
552 | for the mapping in | |
553 | .IR /proc/[number]/maps . | |
554 | The remaining lines show the size of the mapping, | |
555 | the amount of the mapping that is currently resident in RAM, | |
556 | the number clean and dirty shared pages in the mapping, | |
557 | and the number clean and dirty private pages in the mapping. | |
558 | ||
097585ed MK |
559 | This file is only present if the |
560 | .B CONFIG_MMU | |
561 | kernel configuration | |
b07b19c4 MK |
562 | option is enabled. |
563 | .TP | |
fea681da | 564 | .I /proc/[number]/stat |
c13182ef MK |
565 | Status information about the process. |
566 | This is used by | |
567 | .BR ps (1). | |
568 | It is defined in | |
fea681da MK |
569 | .IR /usr/src/linux/fs/proc/array.c "." |
570 | ||
571 | The fields, in order, with their proper | |
572 | .BR scanf (3) | |
573 | format specifiers, are: | |
574 | .RS | |
575 | .TP | |
576 | \fIpid\fP %d | |
357cf3fe | 577 | The process ID. |
fea681da MK |
578 | .TP |
579 | \fIcomm\fP %s | |
c13182ef MK |
580 | The filename of the executable, in parentheses. |
581 | This is visible whether or not the executable is swapped out. | |
fea681da MK |
582 | .TP |
583 | \fIstate\fP %c | |
584 | One character from the string "RSDZTW" where R is running, S is | |
585 | sleeping in an interruptible wait, D is waiting in uninterruptible | |
586 | disk sleep, Z is zombie, T is traced or stopped (on a signal), | |
587 | and W is paging. | |
588 | .TP | |
589 | \fIppid\fP %d | |
590 | The PID of the parent. | |
591 | .TP | |
592 | \fIpgrp\fP %d | |
593 | The process group ID of the process. | |
594 | .TP | |
595 | \fIsession\fP %d | |
596 | The session ID of the process. | |
597 | .TP | |
598 | .\" tty_nr needs better explanation. | |
599 | \fItty_nr\fP %d | |
600 | The tty the process uses. | |
601 | .TP | |
602 | \fItpgid\fP %d | |
603 | .\" This field and following, up to and including wchan added 0.99.1 | |
604 | The process group ID of the process which currently owns the tty that | |
605 | the process is connected to. | |
606 | .TP | |
2ebfeb1b | 607 | \fIflags\fP %u (%lu before Linux 2.6.22) |
c13182ef MK |
608 | The kernel flags word of the process. |
609 | For bit meanings, | |
fea681da MK |
610 | see the PF_* defines in |
611 | .IR <linux/sched.h> . | |
612 | Details depend on the kernel version. | |
613 | .TP | |
614 | \fIminflt\fP %lu | |
615 | The number of minor faults the process has made which have not | |
616 | required loading a memory page from disk. | |
617 | .TP | |
618 | \fIcminflt\fP %lu | |
619 | The number of minor faults that the process's | |
620 | waited-for children have made. | |
621 | .TP | |
622 | \fImajflt\fP %lu | |
623 | The number of major faults the process has made which have | |
624 | required loading a memory page from disk. | |
625 | .TP | |
626 | \fIcmajflt\fP %lu | |
627 | The number of major faults that the process's | |
628 | waited-for children have made. | |
629 | .TP | |
630 | \fIutime\fP %lu | |
631 | The number of jiffies that this process has been scheduled in user | |
632 | mode. | |
633 | .TP | |
634 | \fIstime\fP %lu | |
635 | The number of jiffies that this process has been scheduled in kernel | |
636 | mode. | |
637 | .TP | |
638 | \fIcutime\fP %ld | |
639 | The number of jiffies that this process's | |
c13182ef MK |
640 | waited-for children have been scheduled in user mode. |
641 | (See also | |
fea681da MK |
642 | .BR times (2).) |
643 | .TP | |
644 | \fIcstime\fP %ld | |
645 | The number of jiffies that this process's | |
646 | waited-for children have been scheduled in kernel mode. | |
647 | .TP | |
648 | \fIpriority\fP %ld | |
c13182ef MK |
649 | The standard nice value, plus fifteen. |
650 | The value is never negative in the kernel. | |
fea681da MK |
651 | .TP |
652 | \fInice\fP %ld | |
8729177b | 653 | The nice value ranges from 19 (nicest) to \-19 (not nice to others). |
fea681da MK |
654 | .TP |
655 | .\" .TP | |
656 | .\" \fIcounter\fP %ld | |
657 | .\" The current maximum size in jiffies of the process's next timeslice, | |
658 | .\" or what is currently left of its current timeslice, if it is the | |
659 | .\" currently running process. | |
660 | .\" .TP | |
661 | .\" \fItimeout\fP %u | |
662 | .\" The time in jiffies of the process's next timeout. | |
0e94f77b MK |
663 | .\" timeout was removed sometime around 2.1/2.2 |
664 | \fInum_threads\fP %ld | |
2ebfeb1b | 665 | Number of threads in this process (since Linux 2.6). |
bb83d1b9 | 666 | Before kernel 2.6, this field was hard coded to 0 as a placeholder |
0e94f77b | 667 | for an earlier removed field. |
fea681da MK |
668 | .TP |
669 | \fIitrealvalue\fP %ld | |
8bd58774 MK |
670 | The time in jiffies before the next |
671 | .B SIGALRM | |
672 | is sent to the process due to an interval timer. | |
0e94f77b MK |
673 | Since kernel 2.6.17, this field is no longer maintained, |
674 | and is hard coded as 0. | |
fea681da | 675 | .TP |
0e94f77b | 676 | \fIstarttime\fP %llu (was %lu before Linux 2.6) |
fea681da MK |
677 | The time in jiffies the process started after system boot. |
678 | .TP | |
679 | \fIvsize\fP %lu | |
680 | Virtual memory size in bytes. | |
681 | .TP | |
682 | \fIrss\fP %ld | |
683 | Resident Set Size: number of pages the process has in real memory, | |
c13182ef MK |
684 | minus 3 for administrative purposes. |
685 | This is just the pages which | |
686 | count towards text, data, or stack space. | |
687 | This does not include pages | |
fea681da MK |
688 | which have not been demand-loaded in, or which are swapped out. |
689 | .TP | |
690 | \fIrlim\fP %lu | |
691 | Current limit in bytes on the rss of the process (usually | |
692 | 4294967295 on i386). | |
693 | .TP | |
694 | \fIstartcode\fP %lu | |
695 | The address above which program text can run. | |
696 | .TP | |
697 | \fIendcode\fP %lu | |
698 | The address below which program text can run. | |
699 | .TP | |
700 | \fIstartstack\fP %lu | |
701 | The address of the start of the stack. | |
702 | .TP | |
703 | \fIkstkesp\fP %lu | |
704 | The current value of esp (stack pointer), as found in the | |
705 | kernel stack page for the process. | |
706 | .TP | |
707 | \fIkstkeip\fP %lu | |
708 | The current EIP (instruction pointer). | |
709 | .TP | |
710 | \fIsignal\fP %lu | |
0c6085e0 | 711 | The bitmap of pending signals. |
fea681da MK |
712 | .TP |
713 | \fIblocked\fP %lu | |
0c6085e0 | 714 | The bitmap of blocked signals. |
fea681da MK |
715 | .TP |
716 | \fIsigignore\fP %lu | |
717 | The bitmap of ignored signals. | |
718 | .TP | |
719 | \fIsigcatch\fP %lu | |
0c6085e0 | 720 | The bitmap of caught signals. |
fea681da MK |
721 | .TP |
722 | \fIwchan\fP %lu | |
c13182ef MK |
723 | This is the "channel" in which the process is waiting. |
724 | It is the | |
fea681da | 725 | address of a system call, and can be looked up in a namelist if you |
c13182ef | 726 | need a textual name. |
9a67332e MK |
727 | (If you have an up-to-date |
728 | .IR /etc/psdatabase , | |
729 | then | |
4d9b6984 | 730 | try \fIps \-l\fP to see the WCHAN field in action.) |
fea681da MK |
731 | .TP |
732 | \fInswap\fP %lu | |
0e94f77b | 733 | .\" nswap was added in 2.0 |
4d9b6984 | 734 | Number of pages swapped (not maintained). |
fea681da MK |
735 | .TP |
736 | \fIcnswap\fP %lu | |
0e94f77b | 737 | .\" cnswap was added in 2.0 |
4d9b6984 | 738 | Cumulative \fInswap\fP for child processes (not maintained). |
fea681da | 739 | .TP |
2ebfeb1b | 740 | \fIexit_signal\fP %d (since Linux 2.1.22) |
fea681da MK |
741 | Signal to be sent to parent when we die. |
742 | .TP | |
2ebfeb1b | 743 | \fIprocessor\fP %d (since Linux 2.2.8) |
fea681da | 744 | CPU number last executed on. |
568105c6 | 745 | .TP |
2ebfeb1b | 746 | \fIrt_priority\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22) |
568105c6 MK |
747 | Real-time scheduling priority (see |
748 | .BR sched_setscheduler (2)). | |
749 | .TP | |
2ebfeb1b | 750 | \fIpolicy\fP %u (since Linux 2.5.19; was %lu before Linux 2.6.22) |
568105c6 MK |
751 | Scheduling policy (see |
752 | .BR sched_setscheduler (2)). | |
167450d6 | 753 | .TP |
2ebfeb1b | 754 | \fIdelayacct_blkio_ticks\fP %llu (since Linux 2.6.18) |
0e94f77b | 755 | Aggregated block I/O delays, measured in clock ticks (centiseconds). |
fea681da MK |
756 | .RE |
757 | .TP | |
758 | .I /proc/[number]/statm | |
c13182ef MK |
759 | Provides information about memory status in pages. |
760 | The columns are: | |
a08ea57c MK |
761 | .in +4n |
762 | .nf | |
763 | ||
764 | size total program size | |
765 | resident resident set size | |
766 | share shared pages | |
767 | text text (code) | |
768 | lib library | |
769 | data data/stack | |
770 | dt dirty pages (unused in Linux 2.6) | |
771 | .fi | |
772 | .in | |
fea681da MK |
773 | .TP |
774 | .I /proc/[number]/status | |
775 | Provides much of the information in | |
776 | .I /proc/[number]/stat | |
777 | and | |
778 | .I /proc/[number]/statm | |
779 | in a format that's easier for humans to parse. | |
16b5f7ba MK |
780 | Here's an example: |
781 | .in +4n | |
782 | .nf | |
783 | ||
784 | $ cat /proc/$$/status | |
785 | Name: bash | |
786 | State: S (sleeping) | |
787 | Tgid: 3515 | |
788 | Pid: 3515 | |
789 | PPid: 3452 | |
790 | TracerPid: 0 | |
791 | Uid: 1000 1000 1000 1000 | |
792 | Gid: 100 100 100 100 | |
793 | FDSize: 256 | |
794 | Groups: 16 33 100 | |
795 | VmPeak: 9136 kB | |
796 | VmSize: 7896 kB | |
797 | VmLck: 0 kB | |
798 | VmHWM: 7572 kB | |
799 | VmRSS: 6316 kB | |
800 | VmData: 5224 kB | |
801 | VmStk: 88 kB | |
802 | VmExe: 572 kB | |
803 | VmLib: 1708 kB | |
804 | VmPTE: 20 kB | |
805 | Threads: 1 | |
806 | SigQ: 0/3067 | |
807 | SigPnd: 0000000000000000 | |
808 | ShdPnd: 0000000000000000 | |
809 | SigBlk: 0000000000010000 | |
810 | SigIgn: 0000000000384004 | |
811 | SigCgt: 000000004b813efb | |
812 | CapInh: 0000000000000000 | |
813 | CapPrm: 0000000000000000 | |
814 | CapEff: 0000000000000000 | |
815 | CapBnd: ffffffffffffffff | |
816 | Cpus_allowed: 00000001 | |
817 | Cpus_allowed_list: 0 | |
818 | Mems_allowed: 1 | |
819 | Mems_allowed_list: 0 | |
820 | voluntary_ctxt_switches: 150 | |
821 | nonvoluntary_ctxt_switches: 545 | |
822 | .fi | |
823 | .in | |
824 | .IP | |
825 | The fields are as follows: | |
826 | .RS | |
827 | .IP * 2 | |
828 | .IR Name : | |
829 | Command run by this process. | |
830 | .IP * | |
831 | .IR State : | |
832 | Current state of the process. One of | |
833 | "R (running)", | |
834 | "S (sleeping)", | |
835 | "D (disk sleep)", | |
836 | "T (stopped)", | |
837 | "T (tracing stop)", | |
838 | "Z (zombie)", | |
839 | or | |
840 | "X (dead)". | |
841 | .IP * | |
842 | .IR Tgid : | |
843 | Thread group ID (i.e., Process ID). | |
844 | .IP * | |
845 | .IR Pid : | |
846 | Thread ID (see | |
847 | .BR gettid (2)). | |
848 | .IP * | |
849 | .IR TracerPid : | |
850 | PID of process tracing this process (0 if not being traced). | |
851 | .IP * | |
852 | .IR Uid ", " Gid : | |
853 | Real, effective, saved set, and file system UIDs (GIDs). | |
854 | .IP * | |
855 | .IR FDSize : | |
856 | Number of file descriptor slots currently allocated. | |
857 | .IP * | |
858 | .IR Groups : | |
859 | Supplementary group list. | |
860 | .IP * | |
861 | .IR VmPeak : | |
862 | Peak virtual memory size. | |
863 | .IP * | |
864 | .IR VmSize : | |
865 | Virtual memory size. | |
866 | .IP * | |
867 | .IR VmLck : | |
868 | Locked memory size. | |
869 | .IP * | |
870 | .IR VmHWM : | |
871 | Peak resident set size ("high water mark"). | |
872 | .IP * | |
873 | .IR VmRSS : | |
874 | Resident set size. | |
875 | .IP * | |
876 | .IR VmData ", " VmStk ", " VmExe : | |
877 | Size of data, stack, and text segments. | |
878 | .IP * | |
879 | .IR VmLib : | |
880 | Shared library code size. | |
881 | .IP * | |
882 | .IR VmPTE : | |
883 | Page table entries size (since Linux 2.6.10). | |
884 | .IP * | |
885 | .IR Threads : | |
886 | Number of threads in process containing this thread. | |
887 | .IP * | |
888 | .IR SigPnd ", " ShdPnd : | |
889 | Number of signals pending for thread and for process as a whole (see | |
890 | .BR pthreads (7) | |
891 | and | |
892 | .BR signal (7)). | |
893 | .IP * | |
894 | .IR SigBlk ", " SigIgn ", " SigCgt : | |
895 | Masks indicating signals being blocked, ignored, and caught (see | |
896 | .BR signal (7)). | |
897 | .IP * | |
898 | .IR CapInh ", " CapPrm ", " CapEff : | |
899 | Masks of capabilities enabled in inheritable, permitted, and effective sets | |
900 | (see | |
901 | .BR capabilities (7)). | |
902 | .IP * | |
903 | .IR CapBnd : | |
904 | Capability Bounding set | |
905 | (since kernel 2.6.26, see | |
906 | .BR capabilities (7)). | |
907 | .IP * | |
908 | .IR Cpus_allowed : | |
909 | Mask of CPUs on which this process may run | |
910 | (since Linux 2.6.24, see | |
911 | .BR cpuset (7)). | |
912 | .IP * | |
913 | .IR Cpus_allowed_list : | |
914 | Same as previous, but in "list format" | |
915 | (since Linux 2.6.26, see | |
916 | .BR cpuset (7)). | |
917 | .IP * | |
918 | .IR Mems_allowed : | |
919 | Mask of memory nodes allowed to this process | |
920 | (since Linux 2.6.24, see | |
921 | .BR cpuset (7)). | |
922 | .IP * | |
923 | .IR Mems_allowed_list : | |
924 | Same as previous, but in "list format" | |
925 | (since Linux 2.6.26, see | |
926 | .BR cpuset (7)). | |
927 | .IP * | |
928 | .IR voluntary_context_switches ", " nonvoluntary_context_switches : | |
929 | Number of voluntary and involuntary context switches (since Linux 2.6.23). | |
930 | .RE | |
fea681da | 931 | .TP |
2ebfeb1b | 932 | .IR /proc/[number]/task " (since Linux 2.6.0-test6)" |
afcaf646 MK |
933 | This is a directory that contains one subdirectory |
934 | for each thread in the process. | |
935 | The name of each subdirectory is the numerical thread ID of the | |
936 | thread (see | |
937 | .BR gettid (2)). | |
938 | Within each of these subdirectories, there is a set of | |
939 | files with the same names and contents as under the | |
940 | .I /proc/[number] | |
941 | directories. | |
942 | For attributes that are shared by all threads, the contents for | |
943 | each of the files under the | |
944 | .I task/[thread-ID] | |
945 | subdirectories will be the same as in the corresponding | |
c13182ef | 946 | file in the parent |
afcaf646 MK |
947 | .I /proc/[number] |
948 | directory | |
c13182ef | 949 | (e.g., in a multithreaded process, all of the |
afcaf646 | 950 | .I task/[thread-ID]/cwd |
c13182ef | 951 | files will have the same value as the |
afcaf646 | 952 | .I /proc/[number]/cwd |
c13182ef | 953 | file in the parent directory, since all of the threads in a process |
afcaf646 MK |
954 | share a working directory). |
955 | For attributes that are distinct for each thread, | |
c13182ef | 956 | the corresponding files under |
afcaf646 MK |
957 | .I task/[thread-ID] |
958 | may have different values (e.g., various fields in each of the | |
959 | .I task/[thread-ID]/status | |
960 | files may be different for each thread). | |
961 | ||
962 | .\" The following was still true as at kernel 2.6.13 | |
963 | In a multithreaded process, the contents of the | |
964 | .I /proc/[number]/task | |
c13182ef | 965 | directory are not available if the main thread has already terminated |
afcaf646 MK |
966 | (typically by calling |
967 | .BR pthread_exit (3)). | |
968 | .TP | |
fea681da | 969 | .I /proc/apm |
097585ed MK |
970 | Advanced power management version and battery information when |
971 | .B CONFIG_APM | |
972 | is defined at kernel compilation time. | |
fea681da MK |
973 | .TP |
974 | .I /proc/bus | |
975 | Contains subdirectories for installed busses. | |
976 | .TP | |
977 | .I /proc/bus/pccard | |
097585ed MK |
978 | Subdirectory for pcmcia devices when |
979 | .B CONFIG_PCMCIA | |
980 | is set at kernel compilation time. | |
fea681da MK |
981 | .TP |
982 | .I /proc/bus/pccard/drivers | |
983 | .TP | |
984 | .I /proc/bus/pci | |
c13182ef MK |
985 | Contains various bus subdirectories and pseudo-files containing |
986 | information about pci busses, installed devices, and device | |
987 | drivers. | |
988 | Some of these files are not ASCII. | |
fea681da MK |
989 | .TP |
990 | .I /proc/bus/pci/devices | |
c13182ef MK |
991 | Information about pci devices. |
992 | They may be accessed through | |
fea681da MK |
993 | .BR lspci (8) |
994 | and | |
995 | .BR setpci (8). | |
996 | .TP | |
997 | .I /proc/cmdline | |
c13182ef MK |
998 | Arguments passed to the Linux kernel at boot time. |
999 | Often done via a boot manager such as | |
fea681da | 1000 | .BR lilo (1). |
2bb6d7e6 | 1001 | .\" FIXME Document /proc/config.gz (new in kernel 2.6) |
fea681da MK |
1002 | .TP |
1003 | .I /proc/cpuinfo | |
1004 | This is a collection of CPU and system architecture dependent items, | |
1005 | for each supported architecture a different list. | |
1006 | Two common entries are \fIprocessor\fP which gives CPU number and | |
c13182ef MK |
1007 | \fIbogomips\fP; a system constant that is calculated |
1008 | during kernel initialization. | |
1009 | SMP machines have information for | |
fea681da MK |
1010 | each CPU. |
1011 | .TP | |
1012 | .I /proc/devices | |
c13182ef MK |
1013 | Text listing of major numbers and device groups. |
1014 | This can be used by MAKEDEV scripts for consistency with the kernel. | |
fea681da MK |
1015 | .TP |
1016 | .IR /proc/diskstats " (since Linux 2.5.69)" | |
1017 | This file contains disk I/O statistics for each disk device. | |
1018 | See the kernel source file | |
1019 | .I Documentation/iostats.txt | |
1020 | for further information. | |
1021 | .TP | |
1022 | .I /proc/dma | |
c13182ef | 1023 | This is a list of the registered \fIISA\fP DMA (direct memory access) |
fea681da MK |
1024 | channels in use. |
1025 | .TP | |
1026 | .I /proc/driver | |
1027 | Empty subdirectory. | |
1028 | .TP | |
1029 | .I /proc/execdomains | |
1030 | List of the execution domains (ABI personalities). | |
1031 | .TP | |
1032 | .I /proc/fb | |
097585ed MK |
1033 | Frame buffer information when |
1034 | .B CONFIG_FB | |
1035 | is defined during kernel compilation. | |
fea681da MK |
1036 | .TP |
1037 | .I /proc/filesystems | |
24d01c53 MK |
1038 | A text listing of the file systems which are supported by the kernel, |
1039 | namely file systems which were compiled into the kernel or whose kernel | |
809d0164 | 1040 | modules are currently loaded. (See also |
fb477da2 | 1041 | .BR filesystems (5).) |
24d01c53 | 1042 | If a file system is marked with "nodev", |
809d0164 | 1043 | this means that it does not require a block device to be mounted |
24d01c53 | 1044 | (e.g., virtual file system, network file system). |
809d0164 MK |
1045 | |
1046 | Incidentally, this file may be used by | |
1047 | .BR mount (8) | |
24d01c53 MK |
1048 | when no file system is specified and it didn't manage to determine the |
1049 | file system type. | |
1050 | Then file systems contained in this file are tried | |
809d0164 | 1051 | (excepted those that are marked with "nodev"). |
fea681da MK |
1052 | .TP |
1053 | .I /proc/fs | |
1054 | Empty subdirectory. | |
1055 | .TP | |
1056 | .I /proc/ide | |
1057 | This directory | |
c13182ef MK |
1058 | exists on systems with the ide bus. |
1059 | There are directories for each ide channel and attached device. | |
1060 | Files include: | |
fea681da | 1061 | |
a08ea57c | 1062 | .in +4n |
fea681da MK |
1063 | .nf |
1064 | cache buffer size in KB | |
1065 | capacity number of sectors | |
1066 | driver driver version | |
1067 | geometry physical and logical geometry | |
9fdfa163 | 1068 | identify in hexadecimal |
fea681da MK |
1069 | media media type |
1070 | model manufacturer's model number | |
1071 | settings drive settings | |
9fdfa163 MK |
1072 | smart_thresholds in hexadecimal |
1073 | smart_values in hexadecimal | |
fea681da | 1074 | .fi |
a08ea57c | 1075 | .in |
fea681da | 1076 | |
c13182ef | 1077 | The |
fea681da MK |
1078 | .BR hdparm (8) |
1079 | utility provides access to this information in a friendly format. | |
1080 | .TP | |
1081 | .I /proc/interrupts | |
1082 | This is used to record the number of interrupts per each IRQ on (at | |
c13182ef MK |
1083 | least) the i386 architecture. |
1084 | Very easy to read formatting, done in | |
fea681da MK |
1085 | ASCII. |
1086 | .TP | |
1087 | .I /proc/iomem | |
1088 | I/O memory map in Linux 2.4. | |
1089 | .TP | |
1090 | .I /proc/ioports | |
c13182ef | 1091 | This is a list of currently registered Input-Output port regions that |
fea681da MK |
1092 | are in use. |
1093 | .TP | |
1094 | .IR /proc/kallsyms " (since Linux 2.5.71)" | |
1095 | This holds the kernel exported symbol definitions used by the | |
1096 | .BR modules (X) | |
1097 | tools to dynamically link and bind loadable modules. | |
1098 | In Linux 2.5.47 and earlier, a similar file with slightly different syntax | |
1099 | was named | |
1100 | .IR ksyms . | |
1101 | .TP | |
1102 | .I /proc/kcore | |
1103 | This file represents the physical memory of the system and is stored | |
c13182ef MK |
1104 | in the ELF core file format. |
1105 | With this pseudo-file, and an unstripped | |
9a67332e MK |
1106 | kernel |
1107 | .RI ( /usr/src/linux/vmlinux ) | |
1108 | binary, GDB can be used to | |
fea681da MK |
1109 | examine the current state of any kernel data structures. |
1110 | ||
1111 | The total length of the file is the size of physical memory (RAM) plus | |
1112 | 4KB. | |
1113 | .TP | |
1114 | .I /proc/kmsg | |
1115 | This file can be used instead of the | |
1116 | .BR syslog (2) | |
c13182ef MK |
1117 | system call to read kernel messages. |
1118 | A process must have superuser | |
fea681da | 1119 | privileges to read this file, and only one process should read this |
c13182ef MK |
1120 | file. |
1121 | This file should not be read if a syslog process is running | |
fea681da MK |
1122 | which uses the |
1123 | .BR syslog (2) | |
1124 | system call facility to log kernel messages. | |
1125 | ||
1126 | Information in this file is retrieved with the | |
1127 | .BR dmesg (8) | |
1128 | program. | |
1129 | .TP | |
1130 | .IR /proc/ksyms " (Linux 1.1.23-2.5.47)" | |
1131 | See | |
1132 | .IR /proc/kallsyms . | |
1133 | .TP | |
1134 | .I /proc/loadavg | |
6b05dc38 MK |
1135 | The first three fields in this file are load average figures |
1136 | giving the number of jobs in the run queue (state R) | |
fea681da MK |
1137 | or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes. |
1138 | They are the same as the load average numbers given by | |
1139 | .BR uptime (1) | |
1140 | and other programs. | |
6b05dc38 MK |
1141 | The fourth field consists of two numbers separated by a slash (/). |
1142 | The first of these is the number of currently executing kernel | |
c13182ef | 1143 | scheduling entities (processes, threads); |
6b05dc38 MK |
1144 | this will be less than or equal to the number of CPUs. |
1145 | The value after the slash is the number of kernel scheduling entities | |
1146 | that currently exist on the system. | |
1147 | The fifth field is the PID of the process that was most | |
1148 | recently created on the system. | |
fea681da MK |
1149 | .TP |
1150 | .I /proc/locks | |
1151 | This file shows current file locks | |
1152 | .RB ( flock "(2) and " fcntl (2)) | |
1153 | and leases | |
1154 | .RB ( fcntl (2)). | |
1155 | .TP | |
89dd5f8a | 1156 | .IR /proc/malloc " (only up to and including Linux 2.2)" |
097585ed | 1157 | This file is only present if |
89dd5f8a | 1158 | .B CONFIG_DEBUG_MALLOC |
097585ed | 1159 | was defined during compilation. |
fea681da MK |
1160 | .TP |
1161 | .I /proc/meminfo | |
1162 | This is used by | |
1163 | .BR free (1) | |
1164 | to report the amount of free and used memory (both physical and swap) | |
1165 | on the system as well as the shared memory and buffers used by the | |
1166 | kernel. | |
1167 | ||
1168 | It is in the same format as | |
1169 | .BR free (1), | |
1170 | except in bytes rather than KB. | |
1171 | .TP | |
1172 | .I /proc/mounts | |
1173 | This is a list of all the file systems currently mounted on the system. | |
1174 | The format of this file is documented in | |
31e9a9ec | 1175 | .BR fstab (5). |
c13182ef | 1176 | Since kernel version 2.6.15, this file is pollable: |
57651c15 MK |
1177 | after opening the file for reading, a change in this file |
1178 | (i.e., a file system mount or unmount) causes | |
1179 | .BR select (2) | |
1180 | to mark the file descriptor as readable, and | |
1181 | .BR poll (2) | |
1182 | and | |
1183 | .BR epoll_wait (2) | |
1184 | mark the file as having an error condition. | |
fea681da MK |
1185 | .TP |
1186 | .I /proc/modules | |
1187 | A text list of the modules that have been loaded by the system. | |
1188 | See also | |
1189 | .BR lsmod (8). | |
1190 | .TP | |
1191 | .I /proc/mtrr | |
c13182ef MK |
1192 | Memory Type Range Registers. |
1193 | See | |
fea681da MK |
1194 | .I /usr/src/linux/Documentation/mtrr.txt |
1195 | for details. | |
1196 | .TP | |
1197 | .I /proc/net | |
1198 | various net pseudo-files, all of which give the status of some part of | |
c13182ef MK |
1199 | the networking layer. |
1200 | These files contain ASCII structures and are, | |
1201 | therefore, readable with cat. | |
1202 | However, the standard | |
fea681da MK |
1203 | .BR netstat (8) |
1204 | suite provides much cleaner access to these files. | |
1205 | .TP | |
1206 | .I /proc/net/arp | |
1207 | This holds an ASCII readable dump of the kernel ARP table used for | |
c13182ef MK |
1208 | address resolutions. |
1209 | It will show both dynamically learned and | |
1210 | pre-programmed ARP entries. | |
1211 | The format is: | |
fea681da MK |
1212 | |
1213 | .nf | |
1214 | .ft CW | |
1215 | .in 8n | |
1216 | IP address HW type Flags HW address Mask Device | |
1217 | 192.168.0.50 0x1 0x2 00:50:BF:25:68:F3 * eth0 | |
1218 | 192.168.0.250 0x1 0xc 00:00:00:00:00:00 * eth0 | |
1219 | .ft | |
1220 | .fi | |
1221 | .in | |
1222 | ||
6c04f928 | 1223 | Here "IP address" is the IPv4 address of the machine and the "HW type" |
c13182ef MK |
1224 | is the hardware type of the address from RFC\ 826. |
1225 | The flags are the internal | |
9a67332e MK |
1226 | flags of the ARP structure (as defined in |
1227 | .IR /usr/include/linux/if_arp.h ) | |
1228 | and | |
6c04f928 | 1229 | the "HW address" is the data link layer mapping for that IP address if |
fea681da MK |
1230 | it is known. |
1231 | .TP | |
1232 | .I /proc/net/dev | |
c13182ef MK |
1233 | The dev pseudo-file contains network device status information. |
1234 | This gives | |
1235 | the number of received and sent packets, the number of errors and | |
fea681da | 1236 | collisions |
c13182ef MK |
1237 | and other basic statistics. |
1238 | These are used by the | |
fea681da | 1239 | .BR ifconfig (8) |
c13182ef MK |
1240 | program to report device status. |
1241 | The format is: | |
fea681da MK |
1242 | |
1243 | .nf | |
1244 | .ft CW | |
1245 | .in 1n | |
1246 | Inter-| Receive | Transmit | |
1247 | face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed | |
1248 | lo: 2776770 11307 0 0 0 0 0 0 2776770 11307 0 0 0 0 0 0 | |
1249 | eth0: 1215645 2751 0 0 0 0 0 0 1782404 4324 0 0 0 427 0 0 | |
1250 | ppp0: 1622270 5552 1 0 0 0 0 0 354130 5669 0 0 0 0 0 0 | |
1251 | tap0: 7714 81 0 0 0 0 0 0 7714 81 0 0 0 0 0 0 | |
1252 | .in | |
1253 | .ft | |
1254 | .fi | |
1255 | .\" .TP | |
1256 | .\" .I /proc/net/ipx | |
1257 | .\" No information. | |
1258 | .\" .TP | |
1259 | .\" .I /proc/net/ipx_route | |
1260 | .\" No information. | |
1261 | .TP | |
1262 | .I /proc/net/dev_mcast | |
1263 | Defined in | |
1264 | .IR /usr/src/linux/net/core/dev_mcast.c : | |
1265 | .nf | |
1266 | .in +5 | |
9fdfa163 | 1267 | indx interface_name dmi_u dmi_g dmi_address |
fea681da MK |
1268 | 2 eth0 1 0 01005e000001 |
1269 | 3 eth1 1 0 01005e000001 | |
1270 | 4 eth2 1 0 01005e000001 | |
1271 | .in | |
1272 | .fi | |
1273 | .TP | |
1274 | .I /proc/net/igmp | |
c13182ef MK |
1275 | Internet Group Management Protocol. |
1276 | Defined in | |
fea681da MK |
1277 | .IR /usr/src/linux/net/core/igmp.c . |
1278 | .TP | |
1279 | .I /proc/net/rarp | |
1280 | This file uses the same format as the | |
1281 | .I arp | |
1282 | file and contains the current reverse mapping database used to provide | |
1283 | .BR rarp (8) | |
c13182ef MK |
1284 | reverse address lookup services. |
1285 | If RARP is not configured into the | |
fea681da MK |
1286 | kernel, |
1287 | this file will not be present. | |
1288 | .TP | |
1289 | .I /proc/net/raw | |
c13182ef MK |
1290 | Holds a dump of the RAW socket table. |
1291 | Much of the information is not of | |
fea681da | 1292 | use |
c13182ef | 1293 | apart from debugging. |
6c04f928 | 1294 | The "sl" value is the kernel hash slot for the |
fea681da | 1295 | socket, |
6c04f928 MK |
1296 | the "local_address" is the local address and protocol number pair. |
1297 | \&"St" is | |
c13182ef MK |
1298 | the internal status of the socket. |
1299 | The "tx_queue" and "rx_queue" are the | |
fea681da | 1300 | outgoing and incoming data queue in terms of kernel memory usage. |
94e9d9fe | 1301 | The "tr", "tm\->when", and "rexmits" fields are not used by RAW. |
fdc196f5 MK |
1302 | The "uid" |
1303 | field holds the effective UID of the creator of the socket. | |
fea681da MK |
1304 | .\" .TP |
1305 | .\" .I /proc/net/route | |
1306 | .\" No information, but looks similar to | |
1307 | .\" .BR route (8). | |
1308 | .TP | |
1309 | .I /proc/net/snmp | |
c13182ef | 1310 | This file holds the ASCII data needed for the IP, ICMP, TCP, and UDP |
fea681da | 1311 | management |
763f0e47 | 1312 | information bases for an SNMP agent. |
fea681da MK |
1313 | .TP |
1314 | .I /proc/net/tcp | |
c13182ef MK |
1315 | Holds a dump of the TCP socket table. |
1316 | Much of the information is not | |
1317 | of use apart from debugging. | |
1318 | The "sl" value is the kernel hash slot | |
6beb1671 MK |
1319 | for the socket, the "local_address" is the local address and port number pair. |
1320 | The "rem_address" is the remote address and port number pair | |
6c04f928 MK |
1321 | (if connected). |
1322 | \&"St" is the internal status of the socket. | |
1323 | The "tx_queue" and "rx_queue" are the | |
fea681da | 1324 | outgoing and incoming data queue in terms of kernel memory usage. |
94e9d9fe | 1325 | The "tr", "tm\->when", and "rexmits" fields hold internal information of |
fdc196f5 MK |
1326 | the kernel socket state and are only useful for debugging. |
1327 | The "uid" | |
1328 | field holds the effective UID of the creator of the socket. | |
fea681da MK |
1329 | .TP |
1330 | .I /proc/net/udp | |
c13182ef MK |
1331 | Holds a dump of the UDP socket table. |
1332 | Much of the information is not of | |
1333 | use apart from debugging. | |
1334 | The "sl" value is the kernel hash slot for the | |
6beb1671 MK |
1335 | socket, the "local_address" is the local address and port number pair. |
1336 | The "rem_address" is the remote address and port number pair | |
fea681da MK |
1337 | (if connected). "St" is the internal status of the socket. |
1338 | The "tx_queue" and "rx_queue" are the outgoing and incoming data queue | |
c13182ef | 1339 | in terms of kernel memory usage. |
94e9d9fe | 1340 | The "tr", "tm\->when", and "rexmits" fields |
c13182ef | 1341 | are not used by UDP. |
fdc196f5 MK |
1342 | The "uid" |
1343 | field holds the effective UID of the creator of the socket. | |
fea681da MK |
1344 | The format is: |
1345 | ||
1346 | .nf | |
1347 | .ft CW | |
1348 | .in 1n | |
94e9d9fe | 1349 | sl local_address rem_address st tx_queue rx_queue tr rexmits tm\->when uid |
fea681da MK |
1350 | 1: 01642C89:0201 0C642C89:03FF 01 00000000:00000001 01:000071BA 00000000 0 |
1351 | 1: 00000000:0801 00000000:0000 0A 00000000:00000000 00:00000000 6F000100 0 | |
1352 | 1: 00000000:0201 00000000:0000 0A 00000000:00000000 00:00000000 00000000 0 | |
1353 | .in | |
1354 | .ft | |
1355 | .fi | |
1356 | .TP | |
1357 | .I /proc/net/unix | |
1358 | Lists the UNIX domain sockets present within the system and their | |
c13182ef MK |
1359 | status. |
1360 | The format is: | |
fea681da MK |
1361 | .nf |
1362 | .sp .5 | |
1363 | .ft CW | |
1364 | Num RefCount Protocol Flags Type St Path | |
1365 | 0: 00000002 00000000 00000000 0001 03 | |
1366 | 1: 00000001 00000000 00010000 0001 01 /dev/printer | |
1367 | .ft | |
1368 | .sp .5 | |
1369 | .fi | |
1370 | ||
6c04f928 MK |
1371 | Here "Num" is the kernel table slot number, "RefCount" is the number |
1372 | of users of the socket, "Protocol" is currently always 0, "Flags" | |
fea681da | 1373 | represent the internal kernel flags holding the status of the |
c13182ef | 1374 | socket. |
6c04f928 MK |
1375 | Currently, type is always "1" (Unix domain datagram sockets are |
1376 | not yet supported in the kernel). | |
1377 | \&"St" is the internal state of the | |
fea681da MK |
1378 | socket and Path is the bound path (if any) of the socket. |
1379 | .TP | |
1380 | .I /proc/partitions | |
1381 | Contains major and minor numbers of each partition as well as number | |
1382 | of blocks and partition name. | |
1383 | .TP | |
1384 | .I /proc/pci | |
1385 | This is a listing of all PCI devices found during kernel initialization | |
1386 | and their configuration. | |
2990d781 MK |
1387 | |
1388 | This file has been deprecated in favor of a new /proc | |
1389 | interface for PCI | |
1390 | .RI ( /proc/bus/pci ). | |
1391 | It became optional in Linux 2.2 (available with | |
1392 | .B CONFIG_PCI_OLD_PROC | |
1393 | set at kernel compilation). | |
1394 | It became once more non-optionally enabled in Linux 2.4. | |
1395 | Next, it was deprecated in Linux 2.6 (still available with | |
1396 | .B CONFIG_PCI_LEGACY_PROC | |
1397 | set), and finally removed altogether since Linux 2.6.17. | |
b4e9ee8f MK |
1398 | .\" FIXME /proc/sched_debug |
1399 | .\" .TP | |
1400 | .\" .IR /proc/sched_debug " (since Linux 2.6.23)" | |
1401 | .\" See also /proc/PID/sched | |
fea681da MK |
1402 | .TP |
1403 | .I /proc/scsi | |
2990d781 MK |
1404 | A directory with the scsi mid-level pseudo-file and various SCSI low-level |
1405 | driver directories, | |
1406 | which contain a file for each SCSI host in this system, all of | |
c13182ef MK |
1407 | which give the status of some part of the SCSI IO subsystem. |
1408 | These files contain ASCII structures and are, therefore, readable with | |
2990d781 | 1409 | .BR cat (1). |
fea681da | 1410 | |
c13182ef | 1411 | You can also write to some of the files to reconfigure the subsystem or |
fea681da MK |
1412 | switch |
1413 | certain features on or off. | |
1414 | .TP | |
1415 | .I /proc/scsi/scsi | |
c13182ef MK |
1416 | This is a listing of all SCSI devices known to the kernel. |
1417 | The listing is | |
fea681da | 1418 | similar to the one seen during bootup. |
c13182ef | 1419 | scsi currently supports only the \fIadd-single-device\fP command which |
fea681da MK |
1420 | allows |
1421 | root to add a hotplugged device to the list of known devices. | |
1422 | ||
c13182ef | 1423 | An |
6c04f928 | 1424 | .B echo \(aqscsi add-single-device 1 0 5 0\(aq > /proc/scsi/scsi |
c13182ef MK |
1425 | will cause |
1426 | host scsi1 to scan on SCSI channel 0 for a device on ID 5 LUN 0. | |
1427 | If there | |
fea681da MK |
1428 | is already a device known on this address or the address is invalid, an |
1429 | error will be returned. | |
1430 | .TP | |
1431 | .I /proc/scsi/[drivername] | |
c13182ef MK |
1432 | \fI[drivername]\fP can currently be NCR53c7xx, aha152x, aha1542, aha1740, |
1433 | aic7xxx, buslogic, eata_dma, eata_pio, fdomain, in2000, pas16, qlogic, | |
1434 | scsi_debug, seagate, t128, u15-24f, ultrastore, or wd7000. | |
1435 | These directories show up for all drivers that registered at least one | |
1436 | SCSI | |
1437 | HBA. | |
1438 | Every directory contains one file per registered host. | |
1439 | Every | |
fea681da | 1440 | host-file is named after the number the host was assigned during |
c13182ef | 1441 | initialization. |
fea681da | 1442 | |
c13182ef | 1443 | Reading these files will usually show driver and host configuration, |
fea681da MK |
1444 | statistics etc. |
1445 | ||
1446 | Writing to these files allows different things on different hosts. | |
1447 | For example, with the \fIlatency\fP and \fInolatency\fP commands, | |
1448 | root can switch on and off command latency measurement code in the | |
c13182ef MK |
1449 | eata_dma driver. |
1450 | With the \fIlockup\fP and \fIunlock\fP commands, | |
1451 | root can control bus lockups simulated by the scsi_debug driver. | |
fea681da MK |
1452 | .TP |
1453 | .I /proc/self | |
24d01c53 | 1454 | This directory refers to the process accessing the /proc file system, |
fea681da MK |
1455 | and is identical to the /proc directory named by the process ID of the |
1456 | same process. | |
1457 | .TP | |
1458 | .I /proc/slabinfo | |
c13182ef | 1459 | Information about kernel caches. |
821643a8 MK |
1460 | Since Linux 2.6.16 this file is only present if the |
1461 | .B CONFIG_SLAB | |
1462 | kernel configuration option is enabled. | |
350038ff | 1463 | The columns in |
38f76cd2 | 1464 | .I /proc/slabinfo |
350038ff | 1465 | are: |
a08ea57c | 1466 | .in +4n |
fea681da | 1467 | .nf |
a08ea57c | 1468 | |
fea681da MK |
1469 | cache-name |
1470 | num-active-objs | |
1471 | total-objs | |
1472 | object-size | |
1473 | num-active-slabs | |
1474 | total-slabs | |
1475 | num-pages-per-slab | |
1476 | .fi | |
a08ea57c MK |
1477 | .in |
1478 | ||
c13182ef | 1479 | See |
fea681da MK |
1480 | .BR slabinfo (5) |
1481 | for details. | |
1482 | .TP | |
1483 | .I /proc/stat | |
c13182ef MK |
1484 | kernel/system statistics. |
1485 | Varies with architecture. | |
1486 | Common | |
fea681da MK |
1487 | entries include: |
1488 | .RS | |
1489 | .TP | |
1490 | \fIcpu 3357 0 4313 1362393\fP | |
bfbfcd18 | 1491 | The amount of time, measured in units of |
b877b392 | 1492 | USER_HZ (1/100ths of a second on most architectures), |
bfbfcd18 MK |
1493 | that the system spent in user mode, |
1494 | user mode with low priority (nice), system mode, and the | |
1495 | idle task, respectively. | |
b09b8526 | 1496 | .\" FIXME Actually, the following info about the /proc/stat 'cpu' field |
777f5a9e | 1497 | .\" does not seem to be quite right (at least in 2.6.12) |
bfbfcd18 | 1498 | The last value should be USER_HZ times the |
fea681da | 1499 | second entry in the uptime pseudo-file. |
ca92ce95 | 1500 | |
bfbfcd18 MK |
1501 | In Linux 2.6 this line includes three additional columns: |
1502 | .I iowait | |
1503 | \- time waiting for I/O to complete (since 2.5.41); | |
1504 | .I irq | |
1505 | \- time servicing interrupts (since 2.6.0-test4); | |
1506 | .I softirq | |
1507 | \- time servicing softirqs (since 2.6.0-test4). | |
ca92ce95 | 1508 | |
9de1f6cc MK |
1509 | Since Linux 2.6.11, there is an eighth column, |
1510 | .I steal | |
1511 | \- stolen time, which is the time spent in other operating systems when | |
1512 | running in a virtualized environment | |
fea681da MK |
1513 | .TP |
1514 | \fIpage 5741 1808\fP | |
1515 | The number of pages the system paged in and the number that were paged | |
1516 | out (from disk). | |
1517 | .TP | |
1518 | \fIswap 1 0\fP | |
1519 | The number of swap pages that have been brought in and out. | |
1520 | .TP | |
c13182ef | 1521 | .\" FIXME The following is not the full picture for the 'intr' of |
777f5a9e | 1522 | .\" /proc/stat on 2.6: |
fea681da | 1523 | \fIintr 1462898\fP |
bfbfcd18 MK |
1524 | This line shows counts of interrupts serviced since boot time, |
1525 | for each of the possible system interrupts. | |
1526 | The first column is the total of all interrupts serviced; | |
1527 | each subsequent column is the total for a particular interrupt. | |
fea681da MK |
1528 | .TP |
1529 | \fIdisk_io: (2,0):(31,30,5764,1,2) (3,0):\fP... | |
1530 | (major,minor):(noinfo, read_io_ops, blks_read, write_io_ops, blks_written) | |
bfbfcd18 MK |
1531 | .br |
1532 | (Linux 2.4 only) | |
fea681da MK |
1533 | .TP |
1534 | \fIctxt 115315\fP | |
1535 | The number of context switches that the system underwent. | |
1536 | .TP | |
1537 | \fIbtime 769041601\fP | |
be9634cf | 1538 | boot time, in seconds since the Epoch (January 1, 1970). |
fea681da MK |
1539 | .TP |
1540 | \fIprocesses 86031\fP | |
1541 | Number of forks since boot. | |
bfbfcd18 MK |
1542 | .TP |
1543 | \fIprocs_running 6\fP | |
1544 | Number of processes in runnable state. | |
1545 | (Linux 2.5.45 onwards.) | |
1546 | .TP | |
1547 | \fIprocs_blocked 2\fP | |
1548 | Number of processes blocked waiting for I/O to complete. | |
1549 | (Linux 2.5.45 onwards.) | |
fea681da MK |
1550 | .RE |
1551 | .TP | |
1552 | .I /proc/swaps | |
c13182ef MK |
1553 | Swap areas in use. |
1554 | See also | |
fea681da MK |
1555 | .BR swapon (8). |
1556 | .TP | |
1557 | .I /proc/sys | |
1558 | This directory (present since 1.3.57) contains a number of files | |
1559 | and subdirectories corresponding to kernel variables. | |
1560 | These variables can be read and sometimes modified using | |
1561 | the \fIproc\fP file system, and the | |
1562 | .BR sysctl (2) | |
c13182ef MK |
1563 | system call. |
1564 | Presently, there are subdirectories | |
fea681da MK |
1565 | .IR abi ", " debug ", " dev ", " fs ", " kernel ", " net ", " proc ", " |
1566 | .IR rxrpc ", " sunrpc " and " vm | |
1567 | that each contain more files and subdirectories. | |
1568 | .TP | |
6ab7c0aa | 1569 | .IR /proc/sys/abi " (since Linux 2.4.10)" |
fea681da | 1570 | This directory may contain files with application binary information. |
6ab7c0aa MK |
1571 | .\" On some systems, it is not present. |
1572 | See the kernel source file | |
1573 | .I Documentation/sysctl/abi.txt | |
1574 | for more information. | |
fea681da MK |
1575 | .TP |
1576 | .I /proc/sys/debug | |
1577 | This directory may be empty. | |
1578 | .TP | |
1579 | .I /proc/sys/dev | |
e2badfdf | 1580 | This directory contains device-specific information (e.g., |
9a67332e | 1581 | .IR dev/cdrom/info ). |
fea681da MK |
1582 | On |
1583 | some systems, it may be empty. | |
1584 | .TP | |
1585 | .I /proc/sys/fs | |
6d64ca9c | 1586 | This contains the subdirectories |
b877b392 | 1587 | .IR binfmt_misc ", " inotify ", and " mqueue , |
fea681da | 1588 | and files |
c13182ef MK |
1589 | .IR dentry-state ", " dir-notify-enable ", " dquot-nr ", " file-max ", " |
1590 | .IR file-nr ", " inode-max ", " inode-nr ", " inode-state ", " | |
1591 | .IR lease-break-time ", " leases-enable ", " | |
43da96f2 MK |
1592 | .IR overflowgid ", " overflowuid ", " |
1593 | .IR suid_dumpable ", " | |
1594 | .IR super-max ", and " super-nr . | |
fea681da MK |
1595 | .TP |
1596 | .I /proc/sys/fs/binfmt_misc | |
c13182ef | 1597 | Documentation for files in this directory can be found |
b877b392 | 1598 | in the kernel sources in |
fea681da MK |
1599 | .IR Documentation/binfmt_misc.txt . |
1600 | .TP | |
1601 | .I /proc/sys/fs/dentry-state | |
c13182ef MK |
1602 | This file contains six numbers, |
1603 | .IR nr_dentry ", " nr_unused ", " age_limit " (age in seconds), " | |
fea681da MK |
1604 | want_pages |
1605 | (pages requested by system) and two dummy values. | |
1606 | nr_dentry seems to be 0 all the time. | |
1607 | nr_unused seems to be the number of unused dentries. | |
1608 | age_limit is the age in seconds after which dcache entries | |
1609 | can be reclaimed when memory is short and want_pages is | |
eba72288 | 1610 | non-zero when the kernel has called shrink_dcache_pages() and the |
fea681da MK |
1611 | dcache isn't pruned yet. |
1612 | .TP | |
1613 | .I /proc/sys/fs/dir-notify-enable | |
1614 | This file can be used to disable or enable the | |
1615 | .I dnotify | |
1616 | interface described in | |
1617 | .BR fcntl (2) | |
1618 | on a system-wide basis. | |
1619 | A value of 0 in this file disables the interface, | |
1620 | and a value of 1 enables it. | |
1621 | .TP | |
1622 | .I /proc/sys/fs/dquot-max | |
1623 | This file shows the maximum number of cached disk quota entries. | |
1624 | On some (2.4) systems, it is not present. | |
1625 | If the number of free cached disk quota entries is very low and | |
1626 | you have some awesome number of simultaneous system users, | |
1627 | you might want to raise the limit. | |
1628 | .TP | |
1629 | .I /proc/sys/fs/dquot-nr | |
1630 | This file shows the number of allocated disk quota | |
1631 | entries and the number of free disk quota entries. | |
1632 | .TP | |
1633 | .I /proc/sys/fs/file-max | |
1634 | This file defines | |
1635 | a system-wide limit on the number of open files for all processes. | |
1636 | (See also | |
1637 | .BR setrlimit (2), | |
1638 | which can be used by a process to set the per-process limit, | |
1639 | .BR RLIMIT_NOFILE , | |
1640 | on the number of files it may open.) | |
1641 | If you get lots | |
1642 | of error messages about running out of file handles, | |
1643 | try increasing this value: | |
1644 | .br | |
1645 | ||
1646 | .br | |
1647 | .nf | |
1648 | .ft CW | |
1649 | echo 100000 > /proc/sys/fs/file-max | |
1650 | .fi | |
1651 | .ft | |
1652 | ||
1653 | The kernel constant | |
7b2b5ea4 | 1654 | .B NR_OPEN |
fea681da MK |
1655 | imposes an upper limit on the value that may be placed in |
1656 | .IR file-max . | |
1657 | ||
c13182ef | 1658 | If you increase |
fea681da MK |
1659 | .IR /proc/sys/fs/file-max "," |
1660 | be sure to increase | |
1661 | .I /proc/sys/fs/inode-max | |
1662 | to 3-4 times the new | |
c13182ef | 1663 | value of |
fea681da MK |
1664 | .IR /proc/sys/fs/file-max "," |
1665 | or you will run out of inodes. | |
1666 | .TP | |
1667 | .I /proc/sys/fs/file-nr | |
1668 | This (read-only) file | |
1669 | gives the number of files presently opened. | |
1670 | It contains three numbers: The number of allocated | |
1671 | file handles, the number of free file handles and the maximum | |
c13182ef MK |
1672 | number of file handles. |
1673 | The kernel allocates file handles dynamically, but it | |
1674 | doesn't free them again. | |
1675 | If the number of allocated files is close to the | |
fea681da MK |
1676 | |
1677 | maximum, you should consider increasing the maximum. | |
1678 | When the number of free file handles is | |
1679 | large, you've encountered a peak in your usage of file | |
1680 | handles and you probably don't need to increase the maximum. | |
1681 | .TP | |
c13182ef | 1682 | .I /proc/sys/fs/inode-max |
fea681da MK |
1683 | This file contains the maximum number of in-memory inodes. |
1684 | On some (2.4) systems, it may not be | |
c13182ef MK |
1685 | present. |
1686 | This value should be 3-4 times larger | |
9bef72b5 MK |
1687 | than the value in file-max, since \fIstdin\fP, \fIstdout\fP |
1688 | and network sockets also | |
c13182ef MK |
1689 | need an inode to handle them. |
1690 | When you regularly run | |
fea681da MK |
1691 | out of inodes, you need to increase this value. |
1692 | .TP | |
1693 | .I /proc/sys/fs/inode-nr | |
1694 | This file contains the first two values from inode-state. | |
1695 | .TP | |
1696 | .I /proc/sys/fs/inode-state | |
1697 | This file | |
c13182ef MK |
1698 | contains seven numbers: nr_inodes, nr_free_inodes, preshrink and four |
1699 | dummy values. | |
1700 | nr_inodes is the number of inodes the system has allocated. | |
1701 | This can be slightly more than inode-max because | |
e02756a4 | 1702 | Linux allocates them one page full at a time. |
fea681da | 1703 | nr_free_inodes represents the number of free inodes. |
eba72288 | 1704 | preshrink is non-zero when the nr_inodes > inode-max and the |
fea681da MK |
1705 | system needs to prune the inode list instead of allocating |
1706 | more. | |
1707 | .TP | |
b877b392 | 1708 | .IR /proc/sys/fs/inotify " (since Linux 2.6.13)" |
c13182ef | 1709 | This directory contains files |
b877b392 MK |
1710 | .IR max_queued_events ", " max_user_instances ", and " max_user_watches , |
1711 | that can be used to limit the amount of kernel memory consumed by the | |
1712 | .I inotify | |
1713 | interface. | |
c13182ef | 1714 | For further details, see |
435b27cc | 1715 | .BR inotify (7). |
b877b392 | 1716 | .TP |
fea681da MK |
1717 | .I /proc/sys/fs/lease-break-time |
1718 | This file | |
1719 | specifies the grace period that the kernel grants to a process | |
1720 | holding a file lease | |
1721 | .RB ( fcntl (2)) | |
1722 | after it has sent a signal to that process notifying it | |
1723 | that another process is waiting to open the file. | |
1724 | If the lease holder does not remove or downgrade the lease within | |
1725 | this grace period, the kernel forcibly breaks the lease. | |
1726 | .TP | |
1727 | .I /proc/sys/fs/leases-enable | |
1728 | This file can be used to enable or disable file leases | |
1729 | .RB ( fcntl (2)) | |
1730 | on a system-wide basis. | |
1731 | If this file contains the value 0, leases are disabled. | |
eba72288 | 1732 | A non-zero value enables leases. |
6d64ca9c MK |
1733 | .TP |
1734 | .IR /proc/sys/fs/mqueue " (since Linux 2.6.6)" | |
c13182ef | 1735 | This directory contains files |
6d64ca9c MK |
1736 | .IR msg_max ", " msgsize_max ", and " queues_max , |
1737 | controlling the resources used by POSIX message queues. | |
96018ebe | 1738 | See |
c13182ef | 1739 | .BR mq_overview (7) |
96018ebe | 1740 | for details. |
6d64ca9c MK |
1741 | .TP |
1742 | .IR /proc/sys/fs/overflowgid " and " /proc/sys/fs/overflowuid | |
1743 | These files | |
1744 | allow you to change the value of the fixed UID and GID. | |
1745 | The default is 65534. | |
24d01c53 | 1746 | Some file systems only support 16-bit UIDs and GIDs, although in Linux |
c13182ef | 1747 | UIDs and GIDs are 32 bits. |
24d01c53 | 1748 | When one of these file systems is mounted |
6d64ca9c MK |
1749 | with writes enabled, any UID or GID that would exceed 65535 is translated |
1750 | to the overflow value before being written to disk. | |
1751 | .TP | |
43da96f2 MK |
1752 | .IR /proc/sys/fs/suid_dumpable " (since Linux 2.6.13)" |
1753 | .\" The following is based on text from Documentation/sysctl/kernel.txt | |
c13182ef | 1754 | The value in this file determines whether core dump files are |
f1162930 MK |
1755 | produced for set-user-ID or otherwise protected/tainted binaries. |
1756 | Three different integer values can be specified: | |
43da96f2 MK |
1757 | .sp |
1758 | \fI0\ (default)\fP | |
d9bfdb9c | 1759 | This provides the traditional (pre-Linux 2.6.13) behavior. |
c13182ef | 1760 | A core dump will not be produced for a process which has |
f1162930 | 1761 | changed credentials (by calling |
c13182ef MK |
1762 | .BR seteuid (2), |
1763 | .BR setgid (2), | |
1764 | or similar, or by executing a set-user-ID or set-group-ID program) | |
f1162930 | 1765 | or whose binary does not have read permission enabled. |
43da96f2 | 1766 | .sp |
f1162930 | 1767 | \fI1\ ("debug")\fP |
43da96f2 | 1768 | All processes dump core when possible. |
c13182ef | 1769 | The core dump is owned by the file system user ID of the dumping process |
f1162930 | 1770 | and no security is applied. |
43da96f2 MK |
1771 | This is intended for system debugging situations only. |
1772 | Ptrace is unchecked. | |
1773 | .sp | |
f1162930 | 1774 | \fI2\ ("suidsafe")\fP |
c13182ef MK |
1775 | Any binary which normally would not be dumped (see "0" above) |
1776 | is dumped readable by root only. | |
f1162930 | 1777 | This allows the user to remove the core dump file but not to read it. |
c13182ef | 1778 | For security reasons core dumps in this mode will not overwrite one |
43da96f2 | 1779 | another or other files. |
b877b392 | 1780 | This mode is appropriate when administrators are |
43da96f2 | 1781 | attempting to debug problems in a normal environment. |
fea681da | 1782 | .TP |
c13182ef MK |
1783 | .I /proc/sys/fs/super-max |
1784 | This file | |
fea681da | 1785 | controls the maximum number of superblocks, and |
24d01c53 | 1786 | thus the maximum number of mounted file systems the kernel |
c13182ef MK |
1787 | can have. |
1788 | You only need to increase super-max if you need to | |
24d01c53 | 1789 | mount more file systems than the current value in super-max |
fea681da MK |
1790 | allows you to. |
1791 | .TP | |
1792 | .I /proc/sys/fs/super-nr | |
c13182ef | 1793 | This file |
24d01c53 | 1794 | contains the number of file systems currently mounted. |
fea681da MK |
1795 | .TP |
1796 | .I /proc/sys/kernel | |
1797 | This directory contains files | |
1798 | .IR acct ", " cad_pid ", " cap-bound ", " | |
1799 | .IR core_pattern ", " core_uses_pid ", " | |
1800 | .IR ctrl-alt-del ", " dentry-state ", " domainname ", " | |
c13182ef | 1801 | .IR hotplug ", " hostname ", " |
fea681da MK |
1802 | .IR htab-reclaim " (PowerPC only), " |
1803 | .IR java-appletviewer " (binfmt_java, obsolete), " | |
1804 | .IR java-interpreter " (binfmt_java, obsolete), " l2cr " (PowerPC only), " | |
c13182ef | 1805 | .IR modprobe ", " msgmax ", " msgmnb ", " |
fea681da MK |
1806 | .IR msgmni ", " osrelease ", " ostype ", " overflowgid ", " overflowuid , |
1807 | .IR panic ", " panic_on_oops ", " pid_max ", " | |
1808 | .IR powersave-nap " (PowerPC only), " printk ", " pty ", " random ", " | |
c13182ef | 1809 | .IR real-root-dev ", " reboot-cmd " (SPARC only), " rtsig-max ", " |
fea681da MK |
1810 | .IR rtsig-nr ", " sem ", " sg-big-buff ", " |
1811 | .IR shmall ", " shmmax ", " shmmni ", " sysrq ", " tainted ", " threads-max , | |
43da96f2 | 1812 | .IR version ", and " zero-paged " (PowerPC only)." |
fea681da MK |
1813 | .TP |
1814 | .I /proc/sys/kernel/acct | |
c13182ef | 1815 | This file |
fea681da MK |
1816 | contains three numbers: highwater, lowwater and frequency. |
1817 | If BSD-style process accounting is enabled these values control | |
d9bfdb9c | 1818 | its behavior. |
24d01c53 | 1819 | If free space on file system where the log lives |
c13182ef MK |
1820 | goes below lowwater percent accounting suspends. |
1821 | If free space gets | |
1822 | above highwater percent accounting resumes. | |
1823 | Frequency determines | |
fea681da | 1824 | how often the kernel checks the amount of free space (value is in |
c13182ef MK |
1825 | seconds). |
1826 | Default values are 4, 2 and 30. | |
fea681da MK |
1827 | That is, suspend accounting if <= 2% of space is free; resume it |
1828 | if >= 4% of space is free; consider information about amount of free space | |
1829 | valid for 30 seconds. | |
1830 | .TP | |
1831 | .I /proc/sys/kernel/cap-bound | |
1832 | This file holds the value of the kernel | |
0daa9e92 | 1833 | .I "capability bounding set" |
fea681da MK |
1834 | (expressed as a signed decimal number). |
1835 | This set is ANDed against the capabilities permitted to a process | |
c13182ef | 1836 | during |
ee6e96c1 | 1837 | .BR execve (2). |
fea681da MK |
1838 | .TP |
1839 | .I /proc/sys/kernel/core_pattern | |
5937fccd MK |
1840 | See |
1841 | .BR core (5). | |
654cc098 | 1842 | .TP |
fea681da | 1843 | .I /proc/sys/kernel/core_uses_pid |
5937fccd MK |
1844 | See |
1845 | .BR core (5). | |
fea681da MK |
1846 | .TP |
1847 | .I /proc/sys/kernel/ctrl-alt-del | |
1848 | This file | |
1849 | controls the handling of Ctrl-Alt-Del from the keyboard. | |
1850 | When the value in this file is 0, Ctrl-Alt-Del is trapped and | |
1851 | sent to the | |
49ec013c | 1852 | .BR init (8) |
fea681da MK |
1853 | program to handle a graceful restart. |
1854 | When the value is > 0, Linux's reaction to a Vulcan | |
1855 | Nerve Pinch (tm) will be an immediate reboot, without even | |
1856 | syncing its dirty buffers. | |
6c04f928 | 1857 | Note: when a program (like dosemu) has the keyboard in "raw" |
fea681da MK |
1858 | mode, the ctrl-alt-del is intercepted by the program before it |
1859 | ever reaches the kernel tty layer, and it's up to the program | |
1860 | to decide what to do with it. | |
1861 | .TP | |
1862 | .I /proc/sys/kernel/hotplug | |
1863 | This file | |
1864 | contains the path for the hotplug policy agent. | |
60849763 | 1865 | The default value in this file is |
9a67332e | 1866 | .IR /sbin/hotplug . |
fea681da MK |
1867 | .TP |
1868 | .IR /proc/sys/kernel/domainname " and " /proc/sys/kernel/hostname | |
1869 | can be used to set the NIS/YP domainname and the | |
1870 | hostname of your box in exactly the same way as the commands | |
8b49407f MK |
1871 | .BR domainname (1) |
1872 | and | |
03d2434e MK |
1873 | .BR hostname (1), |
1874 | that is: | |
fea681da | 1875 | |
a08ea57c MK |
1876 | .in +4n |
1877 | .nf | |
fea681da | 1878 | # echo "darkstar" > /proc/sys/kernel/hostname |
fea681da | 1879 | # echo "mydomain" > /proc/sys/kernel/domainname |
a08ea57c MK |
1880 | .fi |
1881 | .in | |
fea681da | 1882 | |
fea681da | 1883 | has the same effect as |
fea681da | 1884 | |
a08ea57c MK |
1885 | .in +4n |
1886 | .nf | |
fea681da | 1887 | # hostname "darkstar" |
fea681da | 1888 | # domainname "mydomain" |
a08ea57c MK |
1889 | .fi |
1890 | .in | |
fea681da | 1891 | |
fea681da MK |
1892 | Note, however, that the classic darkstar.frop.org has the |
1893 | hostname "darkstar" and DNS (Internet Domain Name Server) | |
1894 | domainname "frop.org", not to be confused with the NIS (Network | |
c13182ef MK |
1895 | Information Service) or YP (Yellow Pages) domainname. |
1896 | These two | |
1897 | domain names are in general different. | |
1898 | For a detailed discussion | |
fea681da MK |
1899 | see the |
1900 | .BR hostname (1) | |
1901 | man page. | |
1902 | .TP | |
1903 | .I /proc/sys/kernel/htab-reclaim | |
eba72288 | 1904 | (PowerPC only) If this file is set to a non-zero value, |
fea681da | 1905 | the PowerPC htab |
9a67332e MK |
1906 | (see kernel file |
1907 | .IR Documentation/powerpc/ppc_htab.txt ) | |
1908 | is pruned | |
fea681da MK |
1909 | each time the system hits the idle loop. |
1910 | .TP | |
1911 | .I /proc/sys/kernel/l2cr | |
1912 | (PowerPC only) This file | |
1913 | contains a flag that controls the L2 cache of G3 processor | |
c13182ef MK |
1914 | boards. |
1915 | If 0, the cache is disabled. | |
eba72288 | 1916 | Enabled if non-zero. |
fea681da MK |
1917 | .TP |
1918 | .I /proc/sys/kernel/modprobe | |
6ab7c0aa MK |
1919 | This file contains the path for the kernel module loader. |
1920 | The default value is | |
1921 | .IR /sbin/modprobe . | |
1922 | The file is only present if the kernel is built with the | |
821643a8 MK |
1923 | .B CONFIG_KMOD |
1924 | option enabled. | |
6ab7c0aa MK |
1925 | It is described by the kernel source file |
1926 | .I Documentation/kmod.txt | |
1927 | (only present in kernel 2.4 and earlier). | |
fea681da MK |
1928 | .TP |
1929 | .I /proc/sys/kernel/msgmax | |
1930 | This file defines | |
1931 | a system-wide limit specifying the maximum number of bytes in | |
1932 | a single message written on a System V message queue. | |
1933 | .TP | |
1934 | .I /proc/sys/kernel/msgmni | |
1935 | This file defines the system-wide limit on the number of | |
1936 | message queue identifiers. | |
1937 | (This file is only present in Linux 2.4 onwards.) | |
1938 | .TP | |
1939 | .I /proc/sys/kernel/msgmnb | |
d9bfdb9c | 1940 | This file defines a system-wide parameter used to initialize the |
fea681da | 1941 | .I msg_qbytes |
568105c6 | 1942 | setting for subsequently created message queues. |
fea681da MK |
1943 | The |
1944 | .I msg_qbytes | |
1945 | setting specifies the maximum number of bytes that may be written to the | |
1946 | message queue. | |
1947 | .TP | |
1948 | .IR /proc/sys/kernel/ostype " and " /proc/sys/kernel/osrelease | |
1949 | These files | |
1950 | give substrings of | |
1951 | .IR /proc/version . | |
1952 | .TP | |
1953 | .IR /proc/sys/kernel/overflowgid " and " /proc/sys/kernel/overflowuid | |
1954 | These files duplicate the files | |
1955 | .I /proc/sys/fs/overflowgid | |
1956 | and | |
1957 | .IR /proc/sys/fs/overflowuid . | |
1958 | .TP | |
1959 | .I /proc/sys/kernel/panic | |
1960 | gives read/write access to the kernel variable | |
1961 | .IR panic_timeout . | |
eba72288 | 1962 | If this is zero, the kernel will loop on a panic; if non-zero |
fea681da | 1963 | it indicates that the kernel should autoreboot after this number |
c13182ef MK |
1964 | of seconds. |
1965 | When you use the | |
fea681da MK |
1966 | software watchdog device driver, the recommended setting is 60. |
1967 | .TP | |
1968 | .I /proc/sys/kernel/panic_on_oops | |
d9bfdb9c | 1969 | This file (new in Linux 2.5) controls the kernel's behavior when an oops |
c13182ef MK |
1970 | or BUG is encountered. |
1971 | If this file contains 0, then the system | |
1972 | tries to continue operation. | |
1973 | If it contains 1, then the system | |
fea681da | 1974 | delays a few seconds (to give klogd time to record the oops output) |
c13182ef | 1975 | and then panics. |
fea681da MK |
1976 | If the |
1977 | .I /proc/sys/kernel/panic | |
eba72288 | 1978 | file is also non-zero then the machine will be rebooted. |
fea681da MK |
1979 | .TP |
1980 | .I /proc/sys/kernel/pid_max | |
c13182ef | 1981 | This file |
fea681da MK |
1982 | (new in Linux 2.5) |
1983 | specifies the value at which PIDs wrap around | |
1984 | (i.e., the value in this file is one greater than the maximum PID). | |
1985 | The default value for this file, 32768, | |
1986 | results in the same range of PIDs as on earlier kernels. | |
c13182ef | 1987 | On 32-bit platforms, 32768 is the maximum value for |
b3b8bd24 | 1988 | .IR pid_max . |
c13182ef | 1989 | On 64-bit systems, |
b3b8bd24 MK |
1990 | .I pid_max |
1991 | can be set to any value up to 2^22 | |
b1b0eb73 MK |
1992 | .RB ( PID_MAX_LIMIT , |
1993 | approximately 4 million). | |
c13182ef | 1994 | .\" Prior to 2.6.10, pid_max could also be raised above 32768 on 32-bit |
b3b8bd24 MK |
1995 | .\" platforms, but this broke /proc/PID |
1996 | .\" See http://marc.theaimsgroup.com/?l=linux-kernel&m=109513010926152&w=2 | |
fea681da MK |
1997 | .TP |
1998 | .IR /proc/sys/kernel/powersave-nap " (PowerPC only)" | |
c13182ef | 1999 | This file contains a flag. |
6c04f928 | 2000 | If set, Linux-PPC will use the "nap" mode of |
fea681da | 2001 | powersaving, |
6c04f928 | 2002 | otherwise the "doze" mode will be used. |
fea681da MK |
2003 | .TP |
2004 | .I /proc/sys/kernel/printk | |
2005 | The four values in this file | |
2006 | are console_loglevel, default_message_loglevel, minimum_console_level and | |
2007 | default_console_loglevel. | |
2008 | These values influence printk() behavior when printing or | |
c13182ef MK |
2009 | logging error messages. |
2010 | See | |
fea681da MK |
2011 | .BR syslog (2) |
2012 | for more info on the different loglevels. | |
2013 | Messages with a higher priority than | |
2014 | console_loglevel will be printed to the console. | |
2015 | Messages without an explicit priority | |
2016 | will be printed with priority default_message_level. | |
2017 | minimum_console_loglevel is the minimum (highest) value to which | |
2018 | console_loglevel can be set. | |
2019 | default_console_loglevel is the default value for console_loglevel. | |
2020 | .TP | |
2021 | .IR /proc/sys/kernel/pty " (since Linux 2.6.4)" | |
c13182ef | 2022 | This directory |
fea681da MK |
2023 | contains two files relating to the number of Unix 98 |
2024 | pseudo-terminals (see | |
2025 | .BR pts (4)) | |
2026 | on the system. | |
2027 | .TP | |
2028 | .I /proc/sys/kernel/pty/max | |
2029 | This file defines the maximum number of pseudo-terminals. | |
2030 | .TP | |
2031 | .I /proc/sys/kernel/pty/nr | |
2032 | This read-only file | |
2033 | indicates how many pseudo-terminals are currently in use. | |
2034 | .TP | |
fea681da MK |
2035 | .I /proc/sys/kernel/random |
2036 | This directory | |
2037 | contains various parameters controlling the operation of the file | |
2038 | .IR /dev/random . | |
c13182ef | 2039 | See |
95a32af8 MK |
2040 | .BR random (4) |
2041 | for further information. | |
fea681da MK |
2042 | .TP |
2043 | .I /proc/sys/kernel/real-root-dev | |
2044 | This file | |
9a67332e MK |
2045 | is documented in the kernel source file |
2046 | .IR Documentation/initrd.txt . | |
fea681da MK |
2047 | .TP |
2048 | .IR /proc/sys/kernel/reboot-cmd " (Sparc only) " | |
2049 | This file seems to be a way to give an argument to the SPARC | |
c13182ef MK |
2050 | ROM/Flash boot loader. |
2051 | Maybe to tell it what to do after | |
fea681da MK |
2052 | rebooting? |
2053 | .TP | |
2054 | .I /proc/sys/kernel/rtsig-max | |
c13182ef | 2055 | (Only in kernels up to and including 2.6.7; see |
70556c17 | 2056 | .BR setrlimit (2)) |
fea681da | 2057 | This file can be used to tune the maximum number |
6f36deb4 | 2058 | of POSIX real-time (queued) signals that can be outstanding |
fea681da MK |
2059 | in the system. |
2060 | .TP | |
2061 | .I /proc/sys/kernel/rtsig-nr | |
70556c17 | 2062 | (Only in kernels up to and including 2.6.7.) |
6f36deb4 | 2063 | This file shows the number POSIX real-time signals currently queued. |
fea681da MK |
2064 | .TP |
2065 | .IR /proc/sys/kernel/sem " (since Linux 2.4)" | |
2066 | This file contains 4 numbers defining limits for System V IPC semaphores. | |
c13182ef | 2067 | These fields are, in order: |
fea681da MK |
2068 | .RS |
2069 | .IP SEMMSL 8 | |
2070 | The maximum semaphores per semaphore set. | |
2071 | .IP SEMMNS 8 | |
2072 | A system-wide limit on the number of semaphores in all semaphore sets. | |
2073 | .IP SEMOPM 8 | |
2074 | The maximum number of operations that may be specified in a | |
2075 | .BR semop (2) | |
2076 | call. | |
2077 | .IP SEMMNI 8 | |
2078 | A system-wide limit on the maximum number of semaphore identifiers. | |
2079 | .RE | |
2080 | .TP | |
2081 | .I /proc/sys/kernel/sg-big-buff | |
c13182ef | 2082 | This file |
fea681da | 2083 | shows the size of the generic SCSI device (sg) buffer. |
5ec8d26f | 2084 | You can't tune it just yet, but you could change it at |
9a67332e MK |
2085 | compile time by editing |
2086 | .I include/scsi/sg.h | |
2087 | and changing | |
b1b0eb73 MK |
2088 | the value of |
2089 | .BR SG_BIG_BUFF . | |
c13182ef | 2090 | However, there shouldn't be any reason to change this value. |
fea681da MK |
2091 | .TP |
2092 | .I /proc/sys/kernel/shmall | |
2093 | This file | |
2094 | contains the system-wide limit on the total number of pages of | |
2095 | System V shared memory. | |
2096 | .TP | |
2097 | .I /proc/sys/kernel/shmmax | |
2098 | This file | |
cf50118f | 2099 | can be used to query and set the run-time limit |
c13182ef | 2100 | on the maximum (System V IPC) shared memory segment size that can be |
fea681da | 2101 | created. |
b1b0eb73 | 2102 | Shared memory segments up to 1GB are now supported in the |
c13182ef | 2103 | kernel. |
b1b0eb73 MK |
2104 | This value defaults to |
2105 | .BR SHMMAX . | |
fea681da MK |
2106 | .TP |
2107 | .I /proc/sys/kernel/shmmni | |
2108 | (available in Linux 2.4 and onwards) | |
2109 | This file | |
2110 | specifies the system-wide maximum number of System V shared memory | |
2111 | segments that can be created. | |
2112 | .TP | |
2113 | .I /proc/sys/kernel/version | |
2114 | contains a string like: | |
fea681da | 2115 | |
3c1a1cdc | 2116 | #5 Wed Feb 25 21:49:24 MET 1998 |
fea681da | 2117 | |
6c04f928 | 2118 | The "#5" means that |
fea681da MK |
2119 | this is the fifth kernel built from this source base and the |
2120 | date behind it indicates the time the kernel was built. | |
2121 | .TP | |
2122 | .IR /proc/sys/kernel/zero-paged " (PowerPC only) " | |
2123 | This file | |
c13182ef | 2124 | contains a flag. |
eba72288 | 2125 | When enabled (non-zero), Linux-PPC will pre-zero pages in |
fea681da MK |
2126 | the idle loop, possibly speeding up get_free_pages. |
2127 | .TP | |
2128 | .I /proc/sys/net | |
2129 | This directory contains networking stuff. | |
81c6dd6c MK |
2130 | Explanations for some of the files under this directory can be found in |
2131 | .BR tcp (7) | |
2132 | and | |
2133 | .BR ip (7). | |
fea681da | 2134 | .TP |
ec650cc1 MK |
2135 | .I /proc/sys/net/core/somaxconn |
2136 | This file defines a ceiling value for the | |
2137 | .I backlog | |
2138 | argument of | |
2139 | .BR listen (2); | |
2140 | see the | |
2141 | .BR listen (2) | |
2142 | manual page for details. | |
2143 | .TP | |
fea681da MK |
2144 | .I /proc/sys/proc |
2145 | This directory may be empty. | |
2146 | .TP | |
2147 | .I /proc/sys/sunrpc | |
2148 | This directory supports Sun remote procedure call for network file system | |
c13182ef MK |
2149 | (NFS). |
2150 | On some systems, it is not present. | |
fea681da MK |
2151 | .TP |
2152 | .I /proc/sys/vm | |
c13182ef | 2153 | This directory contains files for memory management tuning, buffer and |
fea681da MK |
2154 | cache |
2155 | management. | |
2156 | .TP | |
b6c40587 MK |
2157 | .IR /proc/sys/vm/drop_caches " (since Linux 2.6.16)" |
2158 | Writing to this file causes the kernel to drop clean caches, dentries and | |
2159 | inodes from memory, causing that memory to become free. | |
2160 | ||
c13182ef | 2161 | To free pagecache, use |
b6c40587 MK |
2162 | .IR "echo 1 > /proc/sys/vm/drop_caches" ; |
2163 | to free dentries and inodes, use | |
2164 | .IR "echo 2 > /proc/sys/vm/drop_caches" ; | |
2165 | to free pagecache, dentries and inodes, use | |
2166 | .IR "echo 3 > /proc/sys/vm/drop_caches" . | |
2167 | ||
c13182ef | 2168 | Because this is a non-destructive operation and dirty objects |
b6c40587 | 2169 | are not freeable, the |
c13182ef | 2170 | user should run |
b6c40587 MK |
2171 | .BR sync (8) |
2172 | first. | |
2173 | .TP | |
473ad28f MK |
2174 | .IR /proc/sys/vm/legacy_va_layout " (since Linux 2.6.9)" |
2175 | .\" The following is from Documentation/filesystems/proc.txt | |
eba72288 | 2176 | If non-zero, this disable the new 32-bit memory-mapping layout; |
473ad28f MK |
2177 | the kernel will use the legacy (2.4) layout for all processes. |
2178 | .TP | |
fea681da | 2179 | .I /proc/sys/vm/overcommit_memory |
c13182ef MK |
2180 | This file contains the kernel virtual memory accounting mode. |
2181 | Values are: | |
fea681da MK |
2182 | .br |
2183 | 0: heuristic overcommit (this is the default) | |
2184 | .br | |
2185 | 1: always overcommit, never check | |
2186 | .br | |
2187 | 2: always check, never overcommit | |
2188 | .br | |
2189 | In mode 0, calls of | |
2190 | .BR mmap (2) | |
097585ed | 2191 | with |
0daa9e92 | 2192 | .B MAP_NORESERVE |
097585ed | 2193 | set are not checked, and the default check is very weak, |
fea681da | 2194 | leading to the risk of getting a process "OOM-killed". |
eba72288 | 2195 | Under Linux 2.4 any non-zero value implies mode 1. |
fea681da MK |
2196 | In mode 2 (available since Linux 2.6), the total virtual address space |
2197 | on the system is limited to (SS + RAM*(r/100)), | |
2198 | where SS is the size of the swap space, and RAM | |
2199 | is the size of the physical memory, and r is the contents of the file | |
2200 | .IR /proc/sys/vm/overcommit_ratio . | |
2201 | .TP | |
2202 | .I /proc/sys/vm/overcommit_ratio | |
c13182ef | 2203 | See the description of |
fea681da MK |
2204 | .IR /proc/sys/vm/overcommit_memory . |
2205 | .TP | |
2206 | .I /proc/sysvipc | |
c13182ef | 2207 | Subdirectory containing the pseudo-files |
fea681da | 2208 | .IR msg ", " sem " and " shm "." |
c13182ef | 2209 | These files list the System V Interprocess Communication (IPC) objects |
fea681da MK |
2210 | (respectively: message queues, semaphores, and shared memory) |
2211 | that currently exist on the system, | |
2212 | providing similar information to that available via | |
2213 | .BR ipcs (1). | |
2214 | These files have headers and are formatted (one IPC object per line) | |
2215 | for easy understanding. | |
2c5e151c | 2216 | .BR svipc (7) |
fea681da MK |
2217 | provides further background on the information shown by these files. |
2218 | .TP | |
2219 | .I /proc/tty | |
c13182ef | 2220 | Subdirectory containing the pseudo-files and subdirectories for |
fea681da MK |
2221 | tty drivers and line disciplines. |
2222 | .TP | |
2223 | .I /proc/uptime | |
2224 | This file contains two numbers: the uptime of the system (seconds), | |
2225 | and the amount of time spent in idle process (seconds). | |
2226 | .TP | |
2227 | .I /proc/version | |
2228 | This string identifies the kernel version that is currently running. | |
030d3025 MK |
2229 | It includes the contents of |
2230 | .IR /proc/sys/kernel/ostype , | |
0daa9e92 | 2231 | .I /proc/sys/kernel/osrelease |
030d3025 MK |
2232 | and |
2233 | .IR /proc/sys/kernel/version . | |
c13182ef | 2234 | For example: |
fea681da MK |
2235 | .nf |
2236 | .in -2 | |
2237 | .ft CW | |
2238 | Linux version 1.0.9 (quinlan@phaze) #1 Sat May 14 01:51:54 EDT 1994 | |
2239 | .ft | |
2240 | .in +2 | |
2241 | .fi | |
b4e9ee8f MK |
2242 | .\" FIXME Document /proc/timer_list |
2243 | .\" .TP | |
2244 | .\" .IR /proc/timer_list " (since Linux 2.6.21)" | |
2245 | .\" See the 2.6.21 Change log | |
2246 | .\" FIXME Document /proc/timer_stats | |
2247 | .\" .TP | |
2248 | .\" .IR /proc/timer_stats " (since Linux 2.6.21)" | |
2249 | .\" See the 2.6.21 Change log | |
fea681da MK |
2250 | .TP |
2251 | .IR /proc/vmstat " (since Linux 2.6)" | |
2252 | This file displays various virtual memory statistics. | |
363f747c MK |
2253 | .TP |
2254 | .IR /proc/zoneinfo " (since Linux 2.6.13)" | |
2255 | This file display information about memory zones. | |
d9bfdb9c | 2256 | This is useful for analyzing virtual memory behavior. |
218e46f8 | 2257 | .\" FIXME more should be said about /proc/zoneinfo |
e37e3282 MK |
2258 | .SH NOTES |
2259 | Many strings (i.e., the environment and command line) are in | |
f81fb444 | 2260 | the internal format, with sub-fields terminated by null bytes (\(aq\\0\(aq), |
e37e3282 MK |
2261 | so you |
2262 | may find that things are more readable if you use \fIod \-c\fP or \fItr | |
2263 | "\\000" "\\n"\fP to read them. | |
26868e5b | 2264 | Alternatively, \fIecho \`cat <file>\`\fP works well. |
e37e3282 MK |
2265 | |
2266 | This manual page is incomplete, possibly inaccurate, and is the kind | |
2267 | of thing that needs to be updated very often. | |
2268 | .\" .SH ACKNOWLEDGEMENTS | |
2269 | .\" The material on /proc/sys/fs and /proc/sys/kernel is closely based on | |
2270 | .\" kernel source documentation files written by Rik van Riel. | |
fea681da MK |
2271 | .SH "SEE ALSO" |
2272 | .BR cat (1), | |
2273 | .BR find (1), | |
2274 | .BR free (1), | |
fea681da MK |
2275 | .BR ps (1), |
2276 | .BR tr (1), | |
2277 | .BR uptime (1), | |
2278 | .BR chroot (2), | |
2279 | .BR mmap (2), | |
2280 | .BR readlink (2), | |
2281 | .BR syslog (2), | |
2282 | .BR slabinfo (5), | |
2283 | .BR hier (7), | |
2284 | .BR arp (8), | |
2285 | .BR dmesg (8), | |
2286 | .BR hdparm (8), | |
2287 | .BR ifconfig (8), | |
2288 | .BR init (8), | |
2289 | .BR lsmod (8), | |
2290 | .BR lspci (8), | |
809d0164 | 2291 | .BR mount (8), |
fea681da MK |
2292 | .BR netstat (8), |
2293 | .BR procinfo (8), | |
2294 | .BR route (8) | |
2295 | .br | |
2296 | .I /usr/src/linux/Documentation/filesystems/proc.txt |