Sobes.tech
Middle+

What is the /proc directory (procfs) and what is it used for?

sobes.tech AI

Answer from AI

/proc is a virtual filesystem in Linux that displays information about the kernel and processes in the form of files and directories. It does not store data on disk but generates it dynamically upon access.

Why /proc is needed:

  • Allows obtaining system information (e.g., CPU load, memory, devices).
  • Enables viewing and modifying kernel parameters in real-time.
  • Displays information about running processes as directories with their PIDs.

Example usage:

cat /proc/cpuinfo    # processor information
cat /proc/meminfo    # memory information
cat /proc/uptime     # system uptime
ls /proc/[PID]       # files with process information

Thus, /proc is an interface for interacting with the kernel and monitoring the system without the need for special tools.