Difference between revisions of "Notes on /proc and /sys"
Jump to navigation
Jump to search
Getting information from
(Created page with "Under the [http://www.pathname.com/fhs/ Filesystem Heirarchy Standard], <code>/proc</code> is a directories that mounts a [http://en.wikipedia.org/wiki/Procfs procfs] filesystem.…") |
m |
||
Line 1: | Line 1: | ||
− | Under the [http://www.pathname.com/fhs/ Filesystem Heirarchy Standard], <code>/proc</code> is a | + | Under the [http://www.pathname.com/fhs/ Filesystem Heirarchy Standard], <code>/proc</code> is a directory that mounts a [http://en.wikipedia.org/wiki/Procfs procfs] filesystem. In newer kernels, the functions of <code>/proc</code> are being superseded by <code>/sys</code>, which uses the [http://en.wikipedia.org/wiki/Sysfs sysfs] filesystem. These filesystems are designed to offer information about current processes, drivers, and devices running on the operating system and enable some configuration of the host operating system. |
==Getting information from <code>/proc</code>== | ==Getting information from <code>/proc</code>== |
Revision as of 13:39, 5 February 2012
Under the Filesystem Heirarchy Standard, /proc
is a directory that mounts a procfs filesystem. In newer kernels, the functions of /proc
are being superseded by /sys
, which uses the sysfs filesystem. These filesystems are designed to offer information about current processes, drivers, and devices running on the operating system and enable some configuration of the host operating system.
Getting information from /proc
The following are some files under /proc
I find to occasionally be useful.
Hardware Information
/proc/cpuinfo
- A detailed listing of the processor(s) model, speed, cache sizes, flags, and more. Corresponds to
lscpu
/proc/meminfo
- A verbose report on the system's memory. Corresponds to
free
/proc/acpi/battery/
- Directories named after batteries known to the system, with files detailing information and their current state. Corresponds to
acpi
/proc/mdstat
- A listing of the RAID devices known to the system and their current state. Corresponds to
mdadm --detail --scan
/proc/scsi/scsi
- A listing of all disk drives, their type, and which bus they reside on (including optical drives, or drives connected through external interfaces such as USB)
System Information
/proc/loadavg
- Load average numbers on the system. Corresponds to
uptime
/proc/uptime
- Time since the system was booted. Corresponds to
uptime
, and the kernel parameterprintk.time
/proc/mounts
- A listing of currently mounted devices and filesystems. Corresponds to
mount
/proc/partitions
- A listing of the devices, their partitions and number of blocks used known to the operating system
/proc/swaps
- A listing of all swap partitions available to the system
/proc/kcore
- A dump of the system's current memory. There is much
evilfun to be had here. /prov/self/environ
- A listing of all environmental variables. Corresponds to
env
/proc/modules
- A list of all modules currently loaded in the kernel. Corresponds to
lsmod
System Configuration
/proc/sys/kernel/domainname
- Prints the system's domain name, if any. Corresponds to
domainname
, anddnsdomainname
/proc/sys/kernel/hostname
- Prints the system's host name, if any. Corresponds to
hostname
, anddnsdomainname
/proc/sys/kernel/ctrl+alt+del
- Returns either a
0
or a1
0
indicates that the key sequence will be captured by init and initiate a graceful shutdown1
indicates that the key sequence will not be captured, and will shutdown as though you had yanked the power plug
/proc/sys/kernel/sysrq
- A non-zero integer indicates that SysRq key sequences will be acknowledged.