Linux – Proc File system – Part 2

The  interested reader can check the part 1 of the series at the link below

https://www.hitchhikersguidetolearning.com/2020/11/02/linux-proc-file-system-part-1/

Let us look at some of the outputs of different files in the “/proc” folder.

  • /proc/meminfo – This provides statistics about memory usage on the system. Snippet shown below

  • /proc/version – This string identifies the kernel version that is currently running
  • /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/devices – Text listing of major numbers and device groups

The below two accesses provides a lot of information about the virtual memory stats and kernel crypto supported.

  • /proc/vmstat – This file displays various virtual memory statistics  
  • /proc/crypto – A list of the ciphers provided by the kernel crypto API.

The process ID folders contain information about the specific Process with the PID number. The man page (https://man7.org/linux/man-pages/man5/proc.5.html) provides the below explanation 

/proc/[pid] subdirectories :

Each one of these subdirectories contains files and subdirectories exposing information about the process with the corresponding process ID. Underneath each of the /proc/[pid] directories, a task subdirectory 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. The /proc/[pid] subdirectories are visible when iterating through /proc with getdents(2) (and thus are visible when one uses ls(1) to view the contents of /proc).

Sys File System (sysfs) in the Linux Kernel

Comments

  1. Pingback: Linux – Proc File system – Part 1 | Hitch Hiker's Guide to Learning

Leave a Reply

Your email address will not be published. Required fields are marked *