Recent Posts

ads

The /proc Filesystem






The /proc is special because it is also a virtual filesystem. It's sometimes referred to as a process information pseudo-file system.

One misconception that we have to immediately clear up is that the /procdirectory is NOT a real File System, in the sense of the term. It is a Virtual File System. Contained within the procfs are information about processes and other system information. It is mapped to /proc and mounted at boot time.

 It doesn't contain 'real' files but runtime system information (e.g. system memory, devices mounted, hardware configuration, etc). For this reason, it can be regarded as a control and information center for the kernel. 

 This pseudo file system allows you to interact with the internal data-structure of the kernel, get useful information about the processes, and to change settings (by modifying the kernel parameters) on the fly.
 /proc is stored in memory, unlike other file-systems, which are stored on disk
Most of the files in the /proc directory provide the latest glimpse of a system's physical environment. Although these /proc files are virtual, yet they can be viewed using any file editor or programs like 'more', 'less' or 'cat'.

The ones on the right are process ID



We will check first the list of file on /proc file system

We will check on cmdline file




  1. In any numbered directory, you will have a similar file structure. The most important ones, and their descriptions, are as follows:


  • cmdline – command line of the process
  • environ – environmental variables
  • fd – file descriptors
  • limits – contains information about the limits of the process
  • mounts – related information

You will also notice a number of links in the numbered directory:
  • cwd – a link to the current working directory of the process
  • exe – link to the executable of the process
  • root – link to the work directory of the process


We will check om /proc files







I will give you quick rundown on /proc’s files:
  1. /proc/cmdline – Kernel command line information.
  2. /proc/console – Information about current consoles including tty.
  3. /proc/devices – Device drivers currently configured for the running kernel.
  4. /proc/dma – Info about current DMA channels.
  5. /proc/fb – Framebuffer devices.
  6. /proc/filesystems – Current filesystems supported by the kernel.
  7. /proc/iomem – Current system memory map for devices.
  8. /proc/ioports – Registered port regions for input output communication with device.
  9. /proc/loadavg – System load average.
  10. /proc/locks – Files currently locked by kernel.
  11. /proc/meminfo – Info about system memory (see above example).
  12. /proc/misc – Miscellaneous drivers registered for miscellaneous major device.
  13. /proc/modules – Currently loaded kernel modules.
  14. /proc/mounts – List of all mounts in use by system.

These files you don't need to memorize.
Feel free to check these like this:



I hope this information was useful for you and you get enough to initially familiarize with  /proc file system. If you liked what you read, please click like

Thanks for watching
😉


The /proc Filesystem The /proc Filesystem Reviewed by ohhhvictor on November 01, 2018 Rating: 5

No comments:

Facebook

ads
Powered by Blogger.