CertCities.com -- The Ultimate Site for Certified IT Professionals
Post Your Mind in the CertCities.com Forums Share share | bookmark | e-mail
  Microsoft®
  Cisco®
  Security
  Oracle®
  A+/Network+"
  Linux/Unix
  More Certs
  Newsletters
  Salary Surveys
  Forums
  News
  Exam Reviews
  Tips
  Columns
  Features
  PopQuiz
  RSS Feeds
  Press Releases
  Contributors
  About Us
  Search
 

Advanced Search
  Free Newsletter
  Sign-up for the #1 Weekly IT
Certification News
and Advice.
Subscribe to CertCities.com Free Weekly E-mail Newsletter
CertCities.com

See What's New on
Redmondmag.com!

Cover Story: IE8: Behind the 8 Ball

Tech-Ed: Let's (Third) Party!

A Secure Leap into the Cloud

Windows Mobile's New Moves

SQL Speed Secrets


CertCities.com
Let us know what you
think! E-mail us at:



 
 
...Home ... Editorial ... Columns ..Column Story Saturday: April 5, 2014


 Inside the Kernel  
Emmett Dulaney
Emmett Dulaney


 Get Your System 'Proc'-nosis
The /proc filesystem can give you valuable insight into your Linux system. The trick, as Emmett shows, is knowing exactly what you're looking at.
by Emmett Dulaney  
7/29/2009 -- There exists in Linux a unique entity: /proc. While it appears in listings like a directory, /proc is actually a virtual filesystem (in reality, it's more a file system interface to the kernel, but that's delving too deep). Beneath this directory/filesystem, you can find temporary pseudo-files that are created by the running processes and can be used to identify what resources the system is using. Many utilities use what they find in /proc to gain information, and you can, too. The key is to understand what you're seeing.

Processes are depicted as directories, and each has permissions and variables associated with it. In contrast, standard system information is usually shown as files. As an example, the init process will always have a PID number of 1. Because of this, you can get a quick glance at the current state of the system by looking at /proc/1 with the command:

ls -l /proc/1

The following table summarizes some of the files in the /proc file system that provide information about your Linux system. You can view some of these files on your system to see what they contain, but note that not all of them may be present on your system. The specific contents of the /proc file system depend on the kernel configuration and the driver modules that are loaded (which, in turn, depend on your PC's hardware configuration).

File Name

Content

/proc/acpi

Information about Advanced Configuration and Power Interface (ACPI), an industry-standard interface for configuration and power management on laptops, desktops and servers.

/proc/bus

Directory with bus-specific information for each bus type, such as PCI.

/proc/cmdline

The command line used to start the Linux kernel (for example, ro root=LABEL=/ rhgb).

/proc/cpuinfo

Information about the CPU (the microprocessor).

/proc/devices

Available block and character devices in your system.

/proc/dma

Information about direct memory access (DMA) channels used.

/proc/driver/rtc

Information about the PC's real-time clock (RTC).

/proc/filesystems

List of supported file systems.

/proc/ide

Directory containing information about IDE devices.

/proc/interrupts

Information about interrupt request (IRQ) numbers and how they're used. This may not show all the interrupts configured on your system because it only shows the ones in use, and Linux does not begin using an IRQ until a driver is loaded.

/proc/ioports

Information about input/output (I/O) port addresses and how they're used.

/proc/kcore

Image of the physical memory. This will appear as a very large file.

/proc/kmsg

Kernel messages.

/proc/loadavg

Load average (average number of processes waiting to run in the last one, five and 15 minutes).

/proc/locks

Current kernel locks (used to ensure that multiple processes don't write to a file at the same time).

/proc/meminfo

Information about physical memory and swap-space usage.

/proc/misc

Miscellaneous information.

/proc/modules

List of loaded driver modules.

/proc/mounts

List of mounted file systems.

/proc/net

Directory with many subdirectories that contain information about networking.

/proc/partitions

List of partitions known to the Linux kernel.

/proc/pci             

Information about PCI devices found on the system.

/proc/scsi

Directory with information about SCSI devices found on the system (present only if you have a SCSI device).

/proc/stat

Overall statistics about the system.

/proc/swaps

Information about the swap space and how much is used.

/proc/sys

Directory with information about the system. You can change kernel parameters by writing to files in this directory. (Properly using this method to tune system performance requires expertise.)

/proc/uptime

Information about how long the system has been up.

/proc/version

Kernel version number.

Some Examples
If you don't know what processor your computer has, type:

cat /proc/cpuinfo

To save a list of the processing running to a file that you can mail, use the command:

ps -ef > /tmp/proc.txt

To see file system types that are currently available to be used on your system, type:

cat /proc/filesystems

To turn on dynamic IP addressing, type:

echo 1 > /proc/sys/net/ipv4/ip_dynaddr

To turn on IP forwarding (temporarily), type:

echo 1 > /proc/sys/net/ipv4/ip_forward

You can see current system status from the information beneath /proc with this command:

procinfo
A Cousin: The sys Directory
Meet the sys directory, a virtual entity that's the mount-point for a sysfs filesystem used by 2.6-based Linux systems to provide information about the devices and interfaces attached to it. It's analogous to /proc in that /proc holds process information and /sys holds system information. By changing into the /sys/bus and sys/devices directories, you can find files that identify the entities connected with the system.

Emmett Dulaney is the author of several books on Linux, Unix and certification. He can be reached at .

 


More articles by Emmett Dulaney:

-- advertisement --


There are 14 CertCities.com user Comments for “Get Your System 'Proc'-nosis”
Page 1 of 2
7/1/13: louisvuittonttoutlet.com from [email protected] says: ths louisvuittonttoutlet.com http://www.louisvuittonttoutlet.com
7/5/13: gucci outlet from [email protected] says: good share. gucci outlet http://www.guccioutletstore-online.com
7/5/13: louboutin outlet from [email protected] says: good share. louboutin outlet http://www.christianlouboutinoutleta.com
7/26/13: cheap sunglasses from [email protected] says: good articles cheap sunglasses http://www.cheap-sunglass.net/
8/10/13: Benefit Makeup Sale from [email protected] says: Among the most fun you can get without leaving out makeup Benefit Makeup Sale http://www.benefitmakeupcheap.co.uk
8/17/13: fitflops Sale UK from [email protected] says: The way in which shoes Helped Me To get Rich And Famous fitflops Sale UK http://www.fitflopsshoesoutlet.com
8/18/13: ReplicaOakleySunglas from [email protected] says: Be the owner of a sunglass With no need of Putting in A Single Cent Replica Oakley Sunglasses http://www.fakeoakleysglasses.com
8/30/13: wholesale nfl jersey from [email protected] says: thank you for share! wholesale nfl jersey http://www.wholesalenflljerseys.com
9/1/13: michael kors outlet from [email protected] says: good articles michael kors outlet http://www.michaelkorseoutlet.org/
9/5/13: nfl custom jersey from [email protected] says: good articles nfl custom jersey http://www.customnflljerseys.com
First Page   Next Page   Last Page
Your comment about: “Get Your System 'Proc'-nosis”
Name: (optional)
Location: (optional)
E-mail Address: (optional)
Comment:
   

-- advertisement (story continued below) --

top