/proc file system
One of the primary function of porc filesystem to control the access to physical devices on the
server and schedule when and how processes interact with these devices.
Under Linux, all data are stored as files. The /proc/ directory contains another type of file
called a virtual file. Hence, proc is known as virtual filesystem.
I have described some important proc files and directories here for system administration usage:
Some of the directories from /proc
Quote
asound
bus
driver
fs
ide
irq
net
sys
sysvipc
tty
Each time a new process is created, an entry in /proc is created.The name of the directory entry
corresponds to the process identification number (PID) of the created process, so, for example,
a process with a PID of 5985 will have a corresponding directory entry of /proc/5985/.
Note: /usr/bin/procinfo - Shows system status gathered from /proc
These directories are called process directories, as they refer to a process's ID and contain
information specific to that process
* cmdline — Contains the command line arguments that started the process.
* cpu — Provides specific information about the utilization of each of the system's CPUs
* cwd — A link to the current working directory for the process
* environ — Gives a list of the environment variables for the proces
* exe — A link to the executable of this process
* fd — A directory containing all of the file descriptors for a particular process
* maps — Contains memory maps to the various executables and library files associated
with this process.
* mem — The memory held by the process.
* root — A link to the root directory of the process
* stat — A status of the process
* statm — A status of the memory in use by the process
* status - Same as stat and statm but in formated way.
/proc/cmdline
The content of /proc/cmdline is the kernel parameters you pass during boot.
The easiest way to check which boot parameters are passed to the kernel is to execute cat
/proc/cpuinfo
Information about the processor, such as its type, make, model, and
performance.
/proc/devices
List of device drivers configured into the currently running kernel.
/proc/dma
Shows which DMA channels are being used at the moment.
/proc/filesystems
Filesystems configured into the kernel
/proc/interrupts
Shows which interrupts are in use, and how many of each there have been
/proc/ioports
Which I/O ports are in use at the moment.
/proc/loadavg
The /proc/loadavg file contains information about the system load. The first three numbers
represent the number of active tasks on the system—processes that are actually running
/proc/uptime
The /proc/uptime file contains the length of time since the system was booted, as well as the
amount of time since then that the system has been idle. Both are given as floating-point
values, in seconds.
/proc/ mdstat
The /proc/ mdstat file shows no active RAID devices:
/proc/meminfo
cat /proc/meminfo | grep MemTotal
This /proc/meminfo shows the memory status in the form of both high-level and low-level
statistics.
/proc/misc
Miscellaneous pieces of information. This is for information that has no real place within the
rest of the proc filesystem
/proc/modules
Kernel modules currently loaded. Same as 'lsmod' command
/proc/mounts
Shows the list of mounted filesystems
/proc/partitions
Shows all partitions in the disk.
/proc/pci
Information about pci bus
/proc/swaps
Display swap information.
/proc/version
The kernel version.
Netwok Parameter in /proc/net
/proc/net/arp - Display arp table. Similar to arp command.
/proc/net/dev - Shows network devices with statastics.
/proc/net/if_inet6 - List of IPv6 interface addresses
/proc/ip_tables_targets - Parameter shows related to Iptables
/proc/ip_tables_names - Parameter shows related to Iptables
/proc/netstat - network statatics configured at kernel level.
/proc/route - network route, use route command -n option.
/proc/sys/fs/file-max
Max file files Limit
# cat /proc/sys/fs/file-max
52224
/proc/sys/kernel/sysrq
System Request Key on a running kernel.
/proc/sys/kernel/acct
This file contains three numbers: highwater, lowwater and frequency. If BSD-style process
accounting is enabled these values control its behaviour. 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% of space is free; resume it if >= 4% of space is free; consider information about amount of
free space valid for 30 seconds.
/proc/sys/kernel/hostname
This file can be used to set the NIS/YP hostname in exactly the same way as the command
hostname.
/proc/sys/kernel/domainname
This file can be used to set the NIS/YP domainname in exactly the same way as the command
domainname
/proc/sys/kernel/osrelease
The running kernel version.
/proc/sys/kernel/ostype
Guess!!! what its Linux only
/proc/sys/kernel/version
Example: #2 SMP PREEMPT Sun May 21 10:47:59 CEST 2006
#2 means that this is the 2nd kernel built from this source base and the date after it indicates
the time the kernel was built. The only way to tune this info is to rebuild the kernel.
/proc/sys/net - All TCP and network configuration parameter for kernel.
