documentação da pasta PROC do Linux
documentação da pasta PROC do Linux
DESCRIPTION
The proc filesystem is a pseudo-filesystem which provides an
interface to kernel data structures. It is commonly mounted at
/proc. Typically, it is mounted automatically by the system, but it
can also be mounted manually using a command such as:
Most of the files in the proc filesystem are read-only, but some
files are writable, allowing kernel variables to be changed.
Mount options
The proc filesystem supports the following mount options:
Overview
Underneath /proc, there are the following general groups of files and
subdirectories:
/proc/[pid] subdirectories
Each one of these subdirectories contains files and subdirec‐
tories exposing information about the process with the corre‐
sponding process ID.
Underneath each of the /proc/[pid] directories, a task subdi‐
rectory contains subdirectories of the form task/[tid], which
contain corresponding information about each of the threads in
the process, where tid is the kernel thread ID of the thread.
/proc/[tid] subdirectories
Each one of these subdirectories contains files and subdirec‐
tories exposing information about the thread with the corre‐
sponding thread ID. The contents of these directories are the
same as the corresponding /proc/[pid]/task/[tid] directories.
/proc/self
When a process accesses this magic symbolic link, it resolves
to the process's own /proc/[pid] directory.
/proc/thread-self
When a thread accesses this magic symbolic link, it resolves
to the process's own /proc/self/task/[tid] directory.
/proc/[a-z]*
Various other files and subdirectories under /proc expose sys‐
tem-wide information.
/proc/[pid]
There is a numerical subdirectory for each running process;
the subdirectory is named by the process ID. Each /proc/[pid]
subdirectory contains the pseudo-files and directories
described below.
/proc/[pid]/attr
The files in this directory provide an API for security mod‐
ules. The contents of this directory are files that can be
read and written in order to set security-related attributes.
This directory was added to support SELinux, but the intention
was that the API be general enough to support other security
modules. For the purpose of explanation, examples of how
SELinux uses these files are provided below.
/proc/[pid]/cmdline
This read-only file holds the complete command line for the
process, unless the process is a zombie. In the latter case,
there is nothing in this file: that is, a read on this file
will return 0 characters. The command-line arguments appear
in this file as a set of strings separated by null bytes
('\0'), with a further null byte after the last string.
Think of this file as the command line that the process wants
you to see.
$ cd /proc/20/cwd; /bin/pwd
Note that the pwd command is often a shell built-in, and might
not work properly. In bash(1), you may use pwd -P.
/proc/[pid]/environ
This file contains the initial environment that was set when
the currently executing program was started via execve(2).
The entries are separated by null bytes ('\0'), and there may
be a null byte at the end. Thus, to print out the environment
of process 1, you would do:
/proc/[pid]/exe
Under Linux 2.2 and later, this file is a symbolic link con‐
taining the actual pathname of the executed command. This
symbolic link can be dereferenced normally; attempting to open
it will open the executable. You can even type
/proc/[pid]/exe to run another copy of the same executable
that is being run by process [pid]. If the pathname has been
unlinked, the symbolic link will contain the string
'(deleted)' appended to the original pathname. In a multi‐
threaded process, the contents of this symbolic link are not
available if the main thread has already terminated (typically
by calling pthread_exit(3)).
[device]:inode
find(1) with the -inum option can be used to locate the file.
/proc/[pid]/fd/
This is a subdirectory containing one entry for each file
which the process has open, named by its file descriptor, and
which is a symbolic link to the actual file. Thus, 0 is stan‐
dard input, 1 standard output, 2 standard error, and so on.
For file descriptors for pipes and sockets, the entries will
be symbolic links whose content is the file type with the
inode. A readlink(2) call on this file returns a string in
the format:
type:[inode]
anon_inode:<file-type>
$ cat /proc/12015/fdinfo/4
pos: 1000
flags: 01002002
mnt_id: 21
pos: 0
flags: 02
mnt_id: 10
eventfd-count: 40
pos: 0
flags: 02
mnt_id: 10
tfd: 9 events: 19 data: 74253d2500000009
tfd: 7 events: 19 data: 74253d2500000007
pos: 0
flags: 02
mnt_id: 10
sigmask: 0000000000000006
pos: 0
flags: 00
mnt_id: 11
inotify wd:2 ino:7ef82a sdev:800001 mask:800afff ignored_mask:0
fhandle-bytes:8 fhandle-type:1 f_handle:2af87e00220ffd73
inotify wd:1 ino:192627 sdev:800001 mask:800afff ignored_mask:0
fhandle-bytes:8 fhandle-type:1 f_handle:27261900802dfd73
sdev The ID of the device where the target file resides (in
hexadecimal).
mask The mask of events being monitored for the target file
(in hexadecimal).
If the kernel was built with exportfs support, the path to the
target file is exposed as a file handle, via three hexadecimal
fields: fhandle-bytes, fhandle-type, and f_handle.
pos: 0
flags: 02
mnt_id: 11
fanotify flags:0 event-flags:88002
fanotify ino:19264f sdev:800001 mflags:0 mask:1 ignored_mask:0
fhandle-bytes:8 fhandle-type:1 f_handle:4f261900a82dfd73
event-flags
The event_f_flags argument given to fanotify_init(2)
(expressed in hexadecimal).
Each additional line shown in the file contains information
about one of the marks in the fanotify group. Most of these
fields are as for inotify, except:
ignored_mask
The mask of events that are ignored for this mark
(expressed in hexadecimal).
pos: 0
flags: 02004002
mnt_id: 13
clockid: 0
ticks: 0
settime flags: 03
it_value: (7695568592, 640020877)
it_interval: (0, 0)
clockid
This is the numeric value of the clock ID (correspond‐
ing to one of the CLOCK_* constants defined via
<time.h>) that is used to mark the progress of the
timer (in this example, 0 is CLOCK_REALTIME).
settime flags
This field lists the flags with which the timerfd was
last armed (see timerfd_settime(2)), in octal (in this
example, both TFD_TIMER_ABSTIME and TFD_TIMER_CAN‐
CEL_ON_SET are set).
it_value
This field contains the amount of time until the timer
will next expire, expressed in seconds and nanoseconds.
This is always expressed as a relative value, regard‐
less of whether the timer was created using the
TFD_TIMER_ABSTIME flag.
it_interval
This field contains the interval of the timer, in sec‐
onds and nanoseconds. (The it_value and it_interval
fields contain the values that timerfd_gettime(2) on
this file descriptor would return.)
# cat /proc/3828/io
rchar: 323934931
wchar: 323929600
syscr: 632687
syscw: 632675
read_bytes: 0
write_bytes: 323932160
cancelled_write_bytes: 0
cancelled_write_bytes:
The big inaccuracy here is truncate. If a process
writes 1 MB to a file and then deletes the file, it
will in fact perform no writeout. But it will have
been accounted as having caused 1 MB of write. In
other words: this field represents the number of bytes
which this process caused to not happen, by truncating
pagecache. A task can cause "negative" I/O too. If
this task truncates some dirty pagecache, some I/O
which another task has been accounted for (in its
write_bytes) will not be happening.
# ls -l /proc/self/map_files/
lr--------. 1 root root 64 Apr 16 21:31
3252e00000-3252e20000 -> /usr/lib64/ld-2.15.so
...
/proc/[pid]/maps
A file containing the currently mapped memory regions and
their access permissions. See mmap(2) for some further infor‐
mation about memory mappings.
The address field is the address space in the process that the
mapping occupies. The perms field is a set of permissions:
r = read
w = write
x = execute
s = shared
p = private (copy on write)
The offset field is the offset into the file/whatever; dev is
the device (major:minor); inode is the inode on that device.
0 indicates that no inode is associated with the memory
region, as would be the case with BSS (uninitialized data).
[stack]
The initial process's (also known as the main thread's)
stack.
/proc/[pid]/mem
This file can be used to access the pages of a process's mem‐
ory through open(2), read(2), and lseek(2).
(2) parent ID: the ID of the parent mount (or of self for the
root of this mount namespace's mount tree).
* whether the process has a low nice value (i.e., > 0) (+);
and
tation/admin-guide/mm/soft-dirty.rst).
54–0 If the page is present in RAM (bit 63), then these bits
provide the page frame number, which can be used to
index /proc/kpageflags and /proc/kpagecount. If the
page is present in swap (bit 62), then bits 4–0 give
the swap type, and bits 54–5 encode the swap offset.
Before Linux 3.11, bits 60–55 were used to encode the base-2
log of the page size.
/proc/[pid]/root
UNIX and Linux support the idea of a per-process root of the
filesystem, set by the chroot(2) system call. This file is a
symbolic link that points to the process's root directory, and
behaves in the same way as exe, and fd/*.
tus).
rd - readable
wr - writable
ex - executable
sh - shared
mr - may read
mw - may write
me - may execute
ms - may share
gd - stack segment grows down
pf - pure PFN range
dw - disabled write to the mapped file
lo - pages are locked in memory
io - memory mapped I/O area
sr - sequential read advise provided
rr - random read advise provided
dc - do not copy area on fork
de - do not expand area on remapping
ac - area is accountable
nr - swap space is not reserved for the area
ht - area uses huge tlb pages
sf - perform synchronous page faults (since Linux 4.15)
nl - non-linear mapping (removed in Linux 4.0)
ar - architecture specific flag
wf - wipe on fork (since Linux 4.14)
dd - do not include area into core dump
sd - soft-dirty flag (since Linux 3.13)
mm - mixed map area
hg - huge page advise flag
nh - no-huge page advise flag
mg - mergeable advise flag
um - userfaultfd missing pages tracking (since Linux 4.3)
uw - userfaultfd wprotect pages tracking (since Linux
4.3)
/proc/[pid]/stat
Status information about the process. This is used by ps(1).
It is defined in the kernel source file fs/proc/array.c.
(1) pid %d
The process ID.
(2) comm %s
The filename of the executable, in parentheses.
This is visible whether or not the executable is
swapped out.
(3) state %c
One of the following characters, indicating process
state:
R Running
Z Zombie
(4) ppid %d
The PID of the parent of this process.
(5) pgrp %d
The process group ID of the process.
(6) session %d
The session ID of the process.
(7) tty_nr %d
The controlling terminal of the process. (The minor
device number is contained in the combination of
bits 31 to 20 and 7 to 0; the major device number is
in bits 15 to 8.)
(8) tpgid %d
The ID of the foreground process group of the con‐
trolling terminal of the process.
(9) flags %u
The kernel flags word of the process. For bit mean‐
ings, see the PF_* defines in the Linux kernel
source file include/linux/sched.h. Details depend
on the kernel version.
The format for this field was %lu before Linux 2.6.
The format for this field was %lu before Linux 2.6.
/proc/[pid]/statm
Provides information about memory usage, measured in pages.
The columns are:
/proc/[pid]/status
Provides much of the information in /proc/[pid]/stat and
/proc/[pid]/statm in a format that's easier for humans to
parse. Here's an example:
$ cat /proc/$$/status
Name: bash
Umask: 0022
State: S (sleeping)
Tgid: 17248
Ngid: 0
Pid: 17248
PPid: 17200
TracerPid: 0
Uid: 1000 1000 1000 1000
Gid: 100 100 100 100
FDSize: 256
Groups: 16 33 100
NStgid: 17248
NSpid: 17248
NSpgid: 17248
NSsid: 17200
VmPeak: 131168 kB
VmSize: 131168 kB
VmLck: 0 kB
VmPin: 0 kB
VmHWM: 13484 kB
VmRSS: 13484 kB
RssAnon: 10264 kB
RssFile: 3220 kB
RssShmem: 0 kB
VmData: 10332 kB
VmStk: 136 kB
VmExe: 992 kB
VmLib: 2104 kB
VmPTE: 76 kB
VmPMD: 12 kB
VmSwap: 0 kB
HugetlbPages: 0 kB # 4.4
CoreDumping: 0 # 4.15
Threads: 1
SigQ: 0/3067
SigPnd: 0000000000000000
ShdPnd: 0000000000000000
SigBlk: 0000000000010000
SigIgn: 0000000000384004
SigCgt: 000000004b813efb
CapInh: 0000000000000000
CapPrm: 0000000000000000
CapEff: 0000000000000000
CapBnd: ffffffffffffffff
CapAmb: 0000000000000000
NoNewPrivs: 0
Seccomp: 0
Speculation_Store_Bypass: vulnerable
Cpus_allowed: 00000001
Cpus_allowed_list: 0
Mems_allowed: 1
Mems_allowed_list: 0
voluntary_ctxt_switches: 150
nonvoluntary_ctxt_switches: 545
* VmRSS: Resident set size. Note that the value here is the
sum of RssAnon, RssFile, and RssShmem.
Until Linux 4.2, the presence of this file was governed by the
CONFIG_CHECKPOINT_RESTORE kernel configuration option. Since
Linux 4.2, it is governed by the CONFIG_PROC_CHILDREN option.
ID: 1
signal: 60/00007fff86e452a8
notify: signal/pid.2634
ClockID: 0
ID: 0
signal: 60/00007fff86e452a8
notify: signal/pid.2634
ClockID: 1
The lines shown for each timer have the following meanings:
notify The part before the slash specifies the mechanism that
this timer uses to deliver notifications, and is one of
"thread", "signal", or "none". Immediately following
the slash is either the string "tid" for timers with
SIGEV_THREAD_ID notification, or "pid" for timers that
notify by other mechanisms. Following the "." is the
PID of the process (or the kernel thread ID of the
thread) that will be delivered a signal if the timer
delivers notifications via a signal.
ClockID
This field identifies the clock that the timer uses for
measuring time. For most clocks, this is a number that
matches one of the user-space CLOCK_* constants exposed
via <time.h>. CLOCK_PROCESS_CPUTIME_ID timers display
with a value of -6 in this field.
CLOCK_THREAD_CPUTIME_ID timers display with a value of
-2 in this field.
/proc/[tid]
There is a numerical subdirectory for each running thread
that is not a thread group leader (i.e., a thread whose thread
ID is not the same as its process ID); the subdirectory is
named by the thread ID. Each one of these subdirectories con‐
tains files and subdirectories exposing information about the
thread with the thread ID tid. The contents of these directo‐
ries are the same as the corresponding /proc/[pid]/task/[tid]
directories.
/proc/apm
Advanced power management version and battery information when
CONFIG_APM is defined at kernel compilation time.
/proc/buddyinfo
This file contains information which is used for diagnosing
memory fragmentation issues. Each line starts with the iden‐
tification of the node and the name of the zone which together
identify a memory region. This is then followed by the count
of available chunks of a certain order in which these zones
are split. The size in bytes of a certain order is given by
the formula:
(2^order) * PAGE_SIZE
/proc/bus
Contains subdirectories for installed busses.
/proc/bus/pccard
Subdirectory for PCMCIA devices when CONFIG_PCMCIA is set at
kernel compilation time.
/proc/bus/pccard/drivers
/proc/bus/pci
Contains various bus subdirectories and pseudo-files contain‐
ing information about PCI busses, installed devices, and
device drivers. Some of these files are not ASCII.
/proc/bus/pci/devices
Information about PCI devices. They may be accessed through
lspci(8) and setpci(8).
/proc/cmdline
Arguments passed to the Linux kernel at boot time. Often done
via a boot manager such as lilo(8) or grub(8).
/proc/crypto
A list of the ciphers provided by the kernel crypto API. For
/proc/cpuinfo
This is a collection of CPU and system architecture dependent
items, for each supported architecture a different list. Two
common entries are processor which gives CPU number and
bogomips; a system constant that is calculated during kernel
initialization. SMP machines have information for each CPU.
The lscpu(1) command gathers its information from this file.
/proc/devices
Text listing of major numbers and device groups. This can be
used by MAKEDEV scripts for consistency with the kernel.
/proc/dma
This is a list of the registered ISA DMA (direct memory
access) channels in use.
/proc/driver
Empty subdirectory.
/proc/execdomains
List of the execution domains (ABI personalities).
/proc/fb
Frame buffer information when CONFIG_FB is defined during ker‐
nel compilation.
/proc/filesystems
A text listing of the filesystems which are supported by the
kernel, namely filesystems which were compiled into the kernel
or whose kernel modules are currently loaded. (See also
filesystems(5).) If a filesystem is marked with "nodev", this
means that it does not require a block device to be mounted
(e.g., virtual filesystem, network filesystem).
/proc/fs
Contains subdirectories that in turn contain files with infor‐
mation about (certain) mounted filesystems.
/proc/ide
This directory exists on systems with the IDE bus. There are
directories for each IDE channel and attached device. Files
include:
/proc/interrupts
This is used to record the number of interrupts per CPU per IO
device. Since Linux 2.6.24, for the i386 and x86-64 architec‐
tures, at least, this also includes interrupts internal to the
system (that is, not associated with a device as such), such
as NMI (nonmaskable interrupt), LOC (local timer interrupt),
and for SMP systems, TLB (TLB flush interrupt), RES
(rescheduling interrupt), CAL (remote function call inter‐
rupt), and possibly others. Very easy to read formatting,
done in ASCII.
/proc/iomem
I/O memory map in Linux 2.4.
/proc/ioports
This is a list of currently registered Input-Output port
regions that are in use.
/proc/kcore
This file represents the physical memory of the system and is
stored in the ELF core file format. With this pseudo-file,
and an unstripped kernel (/usr/src/linux/vmlinux) binary, GDB
can be used to examine the current state of any kernel data
structures.
/proc/kmsg
This file can be used instead of the syslog(2) system call to
read kernel messages. A process must have superuser privi‐
leges to read this file, and only one process should read this
file. This file should not be read if a syslog process is
running which uses the syslog(2) system call facility to log
kernel messages.
0 - KPF_LOCKED
1 - KPF_ERROR
2 - KPF_REFERENCED
3 - KPF_UPTODATE
4 - KPF_DIRTY
5 - KPF_LRU
6 - KPF_ACTIVE
7 - KPF_SLAB
8 - KPF_WRITEBACK
9 - KPF_RECLAIM
10 - KPF_BUDDY
11 - KPF_MMAP (since Linux 2.6.31)
12 - KPF_ANON (since Linux 2.6.31)
13 - KPF_SWAPCACHE (since Linux 2.6.31)
14 - KPF_SWAPBACKED (since Linux 2.6.31)
15 - KPF_COMPOUND_HEAD (since Linux 2.6.31)
16 - KPF_COMPOUND_TAIL (since Linux 2.6.31)
17 - KPF_HUGE (since Linux 2.6.31)
18 - KPF_UNEVICTABLE (since Linux 2.6.31)
19 - KPF_HWPOISON (since Linux 2.6.31)
20 - KPF_NOPAGE (since Linux 2.6.31)
21 - KPF_KSM (since Linux 2.6.32)
22 - KPF_THP (since Linux 3.4)
23 - KPF_BALLOON (since Linux 3.18)
24 - KPF_ZERO_PAGE (since Linux 4.0)
25 - KPF_IDLE (since Linux 4.3)
/proc/loadavg
The first three fields in this file are load average figures
giving the number of jobs in the run queue (state R) or wait‐
ing for disk I/O (state D) averaged over 1, 5, and 15 minutes.
They are the same as the load average numbers given by
uptime(1) and other programs. The fourth field consists of
two numbers separated by a slash (/). The first of these is
the number of currently runnable kernel scheduling entities
(processes, threads). The value after the slash is the number
of kernel scheduling entities that currently exist on the sys‐
tem. The fifth field is the PID of the process that was most
recently created on the system.
/proc/locks
This file shows current file locks (flock(2) and fcntl(2)) and
leases (fcntl(2)).
(2) The lock type. Values that may appear here include:
(3) Among the strings that can appear here are the following:
ADVISORY
This is an advisory lock.
MANDATORY
This is a mandatory lock.
(4) The type of lock. Values that can appear here are:
(7) The byte offset of the first byte of the lock. For BSD
locks, this value is always 0.
(8) The byte offset of the last byte of the lock. EOF in this
field means that the lock extends to the end of the file.
For BSD locks, the value shown is always EOF.
/proc/meminfo
This file reports statistics about memory usage on the system.
It is used by free(1) to report the amount of free and used
memory (both physical and swap) on the system as well as the
shared memory and buffers used by the kernel. Each line of
the file consists of a parameter name, followed by a colon,
the value of the parameter, and an option unit of measurement
(e.g., "kB"). The list below describes the parameter names
and the format specifier required to read the field value.
Except as noted below, all of the fields have been present
since at least Linux 2.6.0. Some fields are displayed only if
the kernel was configured with various options; those depen‐
dencies are noted in the list.
MemTotal %lu
Total usable RAM (i.e., physical RAM minus a few
reserved bits and the kernel binary code).
MemFree %lu
The sum of LowFree+HighFree.
Buffers %lu
Relatively temporary storage for raw disk blocks that
shouldn't get tremendously large (20 MB or so).
Cached %lu
In-memory cache for files read from the disk (the page
cache). Doesn't include SwapCached.
SwapCached %lu
Memory that once was swapped out, is swapped back in
but still also is in the swap file. (If memory pres‐
sure is high, these pages don't need to be swapped out
again because they are already in the swap file. This
saves I/O.)
Active %lu
Memory that has been used more recently and usually not
reclaimed unless absolutely necessary.
Inactive %lu
Memory which has been less recently used. It is more
eligible to be reclaimed for other purposes.
HighTotal %lu
(Starting with Linux 2.6.19, CONFIG_HIGHMEM is
required.) Total amount of highmem. Highmem is all
memory above ~860 MB of physical memory. Highmem areas
are for use by user-space programs, or for the page
cache. The kernel must use tricks to access this mem‐
ory, making it slower to access than lowmem.
HighFree %lu
(Starting with Linux 2.6.19, CONFIG_HIGHMEM is
required.) Amount of free highmem.
LowTotal %lu
(Starting with Linux 2.6.19, CONFIG_HIGHMEM is
required.) Total amount of lowmem. Lowmem is memory
which can be used for everything that highmem can be
used for, but it is also available for the kernel's use
for its own data structures. Among many other things,
it is where everything from Slab is allocated. Bad
things happen when you're out of lowmem.
LowFree %lu
(Starting with Linux 2.6.19, CONFIG_HIGHMEM is
required.) Amount of free lowmem.
SwapTotal %lu
Total amount of swap space available.
SwapFree %lu
Amount of swap space that is currently unused.
Dirty %lu
Memory which is waiting to get written back to the
disk.
Writeback %lu
Memory which is actively being written back to the
disk.
AnonPages %lu (since Linux 2.6.18)
Non-file backed pages mapped into user-space page
tables.
Mapped %lu
Files which have been mapped into memory (with
mmap(2)), such as libraries.
Slab %lu
In-kernel data structures cache. (See slabinfo(5).)
mentation/vm/overcommit-accounting.rst.
Committed_AS %lu
The amount of memory presently allocated on the system.
The committed memory is a sum of all of the memory
which has been allocated by processes, even if it has
not been "used" by them as of yet. A process which
allocates 1 GB of memory (using malloc(3) or similar),
but touches only 300 MB of that memory will show up as
using only 300 MB of memory even if it has the address
space allocated for the entire 1 GB.
VmallocTotal %lu
Total size of vmalloc memory area.
VmallocUsed %lu
Amount of vmalloc area which is used. Since Linux 4.4,
this field is no longer calculated, and is hard coded
as 0. See /proc/vmallocinfo.
VmallocChunk %lu
Largest contiguous block of vmalloc area which is free.
Since Linux 4.4, this field is no longer calculated and
is hard coded as 0. See /proc/vmallocinfo.
HugePages_Total %lu
(CONFIG_HUGETLB_PAGE is required.) The size of the
pool of huge pages.
HugePages_Free %lu
(CONFIG_HUGETLB_PAGE is required.) The number of huge
pages in the pool that are not yet allocated.
Hugepagesize %lu
(CONFIG_HUGETLB_PAGE is required.) The size of huge
pages.
/proc/modules
A text list of the modules that have been loaded by the sys‐
tem. See also lsmod(8).
/proc/mounts
Before kernel 2.4.19, this file was a list of all the filesys‐
tems currently mounted on the system. With the introduction
of per-process mount namespaces in Linux 2.4.19 (see
mount_namespaces(7)), this file became a link to
/proc/self/mounts, which lists the mount points of the
process's own mount namespace. The format of this file is
documented in fstab(5).
/proc/mtrr
Memory Type Range Registers. See the Linux kernel source file
Documentation/x86/mtrr.txt (or Documentation/mtrr.txt before
Linux 2.6.28) for details.
/proc/net
This directory contains various files and subdirectories con‐
taining information about the networking layer. The files
contain ASCII structures and are, therefore, readable with
cat(1). However, the standard netstat(8) suite provides much
cleaner access to these files.
/proc/net/arp
This holds an ASCII readable dump of the kernel ARP table used
for address resolutions. It will show both dynamically
learned and preprogrammed ARP entries. The format is:
Here "IP address" is the IPv4 address of the machine and the
"HW type" is the hardware type of the address from RFC 826.
The flags are the internal flags of the ARP structure (as
defined in /usr/include/linux/if_arp.h) and the "HW address"
is the data link layer mapping for that IP address if it is
known.
/proc/net/dev
The dev pseudo-file contains network device status informa‐
tion. This gives the number of received and sent packets, the
number of errors and collisions and other basic statistics.
These are used by the ifconfig(8) program to report device
status. The format is:
/proc/net/dev_mcast
Defined in /usr/src/linux/net/core/dev_mcast.c:
/proc/net/igmp
Internet Group Management Protocol. Defined in
/usr/src/linux/net/core/igmp.c.
/proc/net/rarp
This file uses the same format as the arp file and contains
the current reverse mapping database used to provide rarp(8)
reverse address lookup services. If RARP is not configured
into the kernel, this file will not be present.
/proc/net/raw
Holds a dump of the RAW socket table. Much of the information
is not of use apart from debugging. The "sl" value is the
kernel hash slot for the socket, the "local_address" is the
local address and protocol number pair. "St" is the internal
status of the socket. The "tx_queue" and "rx_queue" are the
outgoing and incoming data queue in terms of kernel memory
usage. The "tr", "tm->when", and "rexmits" fields are not
used by RAW. The "uid" field holds the effective UID of the
creator of the socket.
/proc/net/snmp
This file holds the ASCII data needed for the IP, ICMP, TCP,
and UDP management information bases for an SNMP agent.
/proc/net/tcp
Holds a dump of the TCP socket table. Much of the information
is not of use apart from debugging. The "sl" value is the
kernel hash slot for the socket, the "local_address" is the
local address and port number pair. The "rem_address" is the
remote address and port number pair (if connected). "St" is
the internal status of the socket. The "tx_queue" and
"rx_queue" are the outgoing and incoming data queue in terms
of kernel memory usage. The "tr", "tm->when", and "rexmits"
fields hold internal information of the kernel socket state
and are useful only for debugging. The "uid" field holds the
effective UID of the creator of the socket.
/proc/net/udp
Holds a dump of the UDP socket table. Much of the information
is not of use apart from debugging. The "sl" value is the
kernel hash slot for the socket, the "local_address" is the
local address and port number pair. The "rem_address" is the
remote address and port number pair (if connected). "St" is
the internal status of the socket. The "tx_queue" and
"rx_queue" are the outgoing and incoming data queue in terms
of kernel memory usage. The "tr", "tm->when", and "rexmits"
fields are not used by UDP. The "uid" field holds the effec‐
tive UID of the creator of the socket. The format is:
/proc/net/unix
Lists the UNIX domain sockets present within the system and
their status. The format is:
/proc/net/netfilter/nfnetlink_queue
This file contains information about netfilter user-space
queueing, if used. Each line represents a queue. Queues that
have not been subscribed to by user space are not shown.
1 4207 0 2 65535 0 0 0 1
(1) (2) (3)(4) (5) (6) (7) (8)
(5) Copy range; that is, how many bytes of packet payload
should be copied to user space at most.
/proc/partitions
Contains the major and minor numbers of each partition as well
as the number of 1024-byte blocks and the partition name.
/proc/pci
This is a listing of all PCI devices found during kernel ini‐
tialization and their configuration.
/proc/scsi
A directory with the scsi mid-level pseudo-file and various
SCSI low-level driver directories, which contain a file for
each SCSI host in this system, all of which give the status of
some part of the SCSI IO subsystem. These files contain ASCII
structures and are, therefore, readable with cat(1).
/proc/scsi/scsi
This is a listing of all SCSI devices known to the kernel.
The listing is similar to the one seen during bootup. scsi
currently supports only the add-single-device command which
allows root to add a hotplugged device to the list of known
devices.
The command
echo 'scsi add-single-device 1 0 5 0' > /proc/scsi/scsi
/proc/scsi/[drivername]
[drivername] can currently be NCR53c7xx, aha152x, aha1542,
aha1740, aic7xxx, buslogic, eata_dma, eata_pio, fdomain,
in2000, pas16, qlogic, scsi_debug, seagate, t128, u15-24f,
ultrastore, or wd7000. These directories show up for all
drivers that registered at least one SCSI HBA. Every direc‐
tory contains one file per registered host. Every host-file
is named after the number the host was assigned during ini‐
tialization.
Reading these files will usually show driver and host configu‐
ration, statistics, and so on.
/proc/self
This directory refers to the process accessing the /proc
filesystem, and is identical to the /proc directory named by
the process ID of the same process.
/proc/slabinfo
Information about kernel caches. See slabinfo(5) for details.
/proc/stat
kernel/system statistics. Varies with architecture. Common
entries include:
swap 1 0
The number of swap pages that have been brought in and
out.
intr 1462898
This line shows counts of interrupts serviced since
boot time, for each of the possible system interrupts.
The first column is the total of all interrupts ser‐
viced including unnumbered architecture specific inter‐
rupts; each subsequent column is the total for that
particular numbered interrupt. Unnumbered interrupts
are not shown, only summed into the total.
ctxt 115315
The number of context switches that the system under‐
went.
btime 769041601
boot time, in seconds since the Epoch, 1970-01-01
00:00:00 +0000 (UTC).
processes 86031
Number of forks since boot.
procs_running 6
Number of processes in runnable state. (Linux 2.5.45
onward.)
procs_blocked 2
Number of processes blocked waiting for I/O to com‐
plete. (Linux 2.5.45 onward.)
softirq 229245889 94 60001584 13619 5175704 2471304 28
51212741 59130143 0 51240672
This line shows the number of softirq for all CPUs.
The first column is the total of all softirqs and each
subsequent column is the total for particular softirq.
(Linux 2.6.31 onward.)
/proc/swaps
Swap areas in use. See also swapon(8).
/proc/sys
This directory (present since 1.3.57) contains a number of
files and subdirectories corresponding to kernel variables.
These variables can be read and sometimes modified using the
/proc filesystem, and the (deprecated) sysctl(2) system call.
/proc/sys/debug
This directory may be empty.
/proc/sys/dev
This directory contains device-specific information (e.g.,
dev/cdrom/info). On some systems, it may be empty.
/proc/sys/fs
This directory contains the files and subdirectories for ker‐
nel variables related to filesystems.
/proc/sys/fs/binfmt_misc
/proc/sys/fs/dir-notify-enable
This file can be used to disable or enable the dnotify inter‐
face described in fcntl(2) on a system-wide basis. A value of
0 in this file disables the interface, and a value of 1
enables it.
/proc/sys/fs/dquot-max
This file shows the maximum number of cached disk quota
entries. On some (2.4) systems, it is not present. If the
number of free cached disk quota entries is very low and you
have some awesome number of simultaneous system users, you
might want to raise the limit.
/proc/sys/fs/dquot-nr
This file shows the number of allocated disk quota entries and
the number of free disk quota entries.
/proc/sys/fs/file-max
This file defines a system-wide limit on the number of open
files for all processes. System calls that fail when encoun‐
tering this limit fail with the error ENFILE. (See also
setrlimit(2), which can be used by a process to set the per-
process limit, RLIMIT_NOFILE, on the number of files it may
open.) If you get lots of error messages in the kernel log
about running out of file handles (look for "VFS: file-max
limit <number> reached"), try increasing this value:
/proc/sys/fs/file-nr
This (read-only) file contains three numbers: the number of
allocated file handles (i.e., the number of files presently
opened); the number of free file handles; and the maximum num‐
ber of file handles (i.e., the same value as
/proc/sys/fs/file-max). If the number of allocated file han‐
dles is close to the maximum, you should consider increasing
the maximum. Before Linux 2.6, the kernel allocated file han‐
dles dynamically, but it didn't free them again. Instead the
free file handles were kept in a list for reallocation; the
"free file handles" value indicates the size of that list. A
large number of free file handles indicates that there was a
past peak in the usage of open file handles. Since Linux 2.6,
the kernel does deallocate freed file handles, and the "free
file handles" value is always zero.
/proc/sys/fs/inode-nr
This file contains the first two values from inode-state.
/proc/sys/fs/inode-state
This file contains seven numbers: nr_inodes, nr_free_inodes,
preshrink, and four dummy values (always zero).
/proc/sys/fs/lease-break-time
This file specifies the grace period that the kernel grants to
a process holding a file lease (fcntl(2)) after it has sent a
signal to that process notifying it that another process is
waiting to open the file. If the lease holder does not remove
or downgrade the lease within this grace period, the kernel
forcibly breaks the lease.
/proc/sys/fs/leases-enable
This file can be used to enable or disable file leases
(fcntl(2)) on a system-wide basis. If this file contains the
value 0, leases are disabled. A nonzero value enables leases.
· the target file does not have its set-user-ID mode bit
enabled;
· the target file does not have both its set-group-ID and
group-executable mode bits enabled; and
* the symbolic link and its parent directory have the same
owner (UID)
0 (default)
This provides the traditional (pre-Linux 2.6.13) behav‐
ior. A core dump will not be produced for a process
which has changed credentials (by calling seteuid(2),
setgid(2), or similar, or by executing a set-user-ID or
set-group-ID program) or whose binary does not have
read permission enabled.
1 ("debug")
All processes dump core when possible. (Reasons why a
process might nevertheless not dump core are described
in core(5).) The core dump is owned by the filesystem
user ID of the dumping process and no security is
applied. This is intended for system debugging situa‐
tions only: this mode is insecure because it allows
unprivileged users to examine the memory contents of
privileged processes.
2 ("suidsafe")
Any binary which normally would not be dumped (see "0"
above) is dumped readable by root only. This allows
the user to remove the core dump file but not to read
it. For security reasons core dumps in this mode will
not overwrite one another or other files. This mode is
appropriate when administrators are attempting to debug
problems in a normal environment.
/proc/sys/fs/super-max
This file controls the maximum number of superblocks, and thus
the maximum number of mounted filesystems the kernel can have.
You need increase only super-max if you need to mount more
filesystems than the current value in super-max allows you to.
/proc/sys/fs/super-nr
This file contains the number of filesystems currently
mounted.
/proc/sys/kernel
This directory contains files controlling a range of kernel
parameters, as described below.
/proc/sys/kernel/acct
This file contains three numbers: highwater, lowwater, and
frequency. If BSD-style process accounting is enabled, these
values control its behavior. If free space on filesystem
where the log lives goes below lowwater percent, accounting
suspends. If free space gets above highwater percent,
accounting resumes. frequency determines how often the kernel
checks the amount of free space (value is in seconds).
Default values are 4, 2 and 30. That is, suspend accounting
if 2% or less space is free; resume it if 4% or more space is
free; consider information about amount of free space valid
for 30 seconds.
/proc/sys/kernel/core_pattern
See core(5).
/proc/sys/kernel/core_pipe_limit
See core(5).
/proc/sys/kernel/core_uses_pid
See core(5).
/proc/sys/kernel/ctrl-alt-del
This file controls the handling of Ctrl-Alt-Del from the key‐
board. When the value in this file is 0, Ctrl-Alt-Del is
trapped and sent to the init(1) program to handle a graceful
restart. When the value is greater than zero, Linux's reac‐
tion to a Vulcan Nerve Pinch (tm) will be an immediate reboot,
without even syncing its dirty buffers. Note: when a program
(like dosemu) has the keyboard in "raw" mode, the ctrl-alt-del
is intercepted by the program before it ever reaches the ker‐
nel tty layer, and it's up to the program to decide what to do
with it.
# hostname 'darkstar'
# domainname 'mydomain'
/proc/sys/kernel/hotplug
This file contains the pathname for the hotplug policy agent.
The default value in this file is /sbin/hotplug.
/proc/sys/kernel/keys/*
This directory contains various files that define parameters
and limits for the key-management facility. These files are
described in keyrings(7).
/proc/sys/kernel/modprobe
This file contains the pathname for the kernel module loader.
The default value is /sbin/modprobe. The file is present only
if the kernel is built with the CONFIG_MODULES (CONFIG_KMOD in
Linux 2.6.26 and earlier) option enabled. It is described by
the Linux kernel source file Documentation/kmod.txt (present
only in kernel 2.4 and earlier).
nel/auto_msgmni.
/proc/sys/kernel/panic
This file gives read/write access to the kernel variable
panic_timeout. If this is zero, the kernel will loop on a
panic; if nonzero, it indicates that the kernel should autore‐
boot after this number of seconds. When you use the software
watchdog device driver, the recommended setting is 60.
/proc/sys/kernel/printk
See syslog(2).
/proc/sys/kernel/pty/max
This file defines the maximum number of pseudoterminals.
/proc/sys/kernel/pty/nr
This read-only file indicates how many pseudoterminals are
currently in use.
/proc/sys/kernel/random
This directory contains various parameters controlling the
operation of the file /dev/random. See random(4) for further
information.
/proc/sys/kernel/rtsig-max
(Only in kernels up to and including 2.6.7; see setrlimit(2))
This file can be used to tune the maximum number of POSIX
real-time (queued) signals that can be outstanding in the sys‐
tem.
/proc/sys/kernel/rtsig-nr
(Only in kernels up to and including 2.6.7.) This file shows
the number of POSIX real-time signals currently queued.
/proc/sys/kernel/sg-big-buff
This file shows the size of the generic SCSI device (sg) buf‐
fer. You can't tune it just yet, but you could change it at
compile time by editing include/scsi/sg.h and changing the
value of SG_BIG_BUFF. However, there shouldn't be any reason
to change this value.
/proc/sys/kernel/sysrq
This file controls the functions allowed to be invoked by the
SysRq key. By default, the file contains 1 meaning that every
possible SysRq request is allowed (in older kernel versions,
SysRq was disabled by default, and you were required to
specifically enable it at run-time, but this is not the case
any more). Possible values in this file are:
/proc/sys/kernel/version
This file contains a string such as:
The "#5" means that this is the fifth kernel built from this
source base and the date following it indicates the time the
kernel was built.
/proc/sys/net
This directory contains networking stuff. Explanations for
some of the files under this directory can be found in tcp(7)
and ip(7).
/proc/sys/net/core/bpf_jit_enable
See bpf(2).
/proc/sys/net/core/somaxconn
This file defines a ceiling value for the backlog argument of
listen(2); see the listen(2) manual page for details.
/proc/sys/proc
This directory may be empty.
/proc/sys/sunrpc
This directory supports Sun remote procedure call for network
filesystem (NFS). On some systems, it is not present.
/proc/sys/vm
This directory contains files for memory management tuning,
buffer and cache management.
1: Attempt recovery.
ing_task.
/proc/sys/vm/overcommit_memory
This file contains the kernel virtual memory accounting mode.
Values are:
info) is calculated as
where:
/proc/sys/vm/swappiness
The value in this file controls how aggressively the kernel
will swap memory pages. Higher values increase aggressive‐
ness, lower values decrease aggressiveness. The default value
is 60.
/proc/sysvipc
Subdirectory containing the pseudo-files msg, sem and shm.
These files list the System V Interprocess Communication (IPC)
objects (respectively: message queues, semaphores, and shared
memory) that currently exist on the system, providing similar
information to that available via ipcs(1). These files have
headers and are formatted (one IPC object per line) for easy
understanding. sysvipc(7) provides further background on the
information shown by these files.
$ cat /proc/timer_stats
$ cat /proc/timer_stats
Timer Stats Version: v0.3
Sample period: 1.764 s
Collection: active
255, 0 swapper/3 hrtimer_start_range_ns (tick_sched_timer)
71, 0 swapper/1 hrtimer_start_range_ns (tick_sched_timer)
58, 0 swapper/0 hrtimer_start_range_ns (tick_sched_timer)
4, 1694 gnome-shell mod_delayed_work_on (delayed_work_timer_fn)
17, 7 rcu_sched rcu_gp_kthread (process_timeout)
...
1, 4911 kworker/u16:0 mod_delayed_work_on (delayed_work_timer_fn)
1D, 2522 kworker/0:0 queue_delayed_work_on (delayed_work_timer_fn)
1029 total events, 583.333 events/sec
/proc/tty
Subdirectory containing the pseudo-files and subdirectories
for tty drivers and line disciplines.
/proc/uptime
This file contains two numbers (values in seconds): the uptime
of the system (including time spent in suspend) and the amount
of time spent in the idle process.
/proc/version
This string identifies the kernel version that is currently
running. It includes the contents of /proc/sys/kernel/ostype,
/proc/sys/kernel/osrelease and /proc/sys/kernel/version. For
example:
pgsteal_direct_dma
pgscan_kswapd_dma
pgscan_kswapd_high
pgscan_kswapd_movable (since Linux 2.6.23)
pgscan_direct_dma
pgscan_direct_normal
pgscan_direct_high
tion/admin-guide/mm/transhuge.rst.
tion/admin-guide/mm/transhuge.rst.
tion/admin-guide/mm/transhuge.rst.
htlb_buddy_alloc_success (since Linux 2.6.26)
tion/admin-guide/mm/transhuge.rst.
tion/admin-guide/mm/transhuge.rst.
tion/admin-guide/mm/transhuge.rst.
tion/admin-guide/mm/transhuge.rst.
tion/admin-guide/mm/transhuge.rst.
tion/admin-guide/mm/transhuge.rst.
tion/admin-guide/mm/transhuge.rst.
NOTES top
Many files contain strings (e.g., the environment and command line)
that are in the internal format, with subfields terminated by null
bytes ('\0'). When inspecting such files, you may find that the
results are more readable if you use a command of the following form
to display them: