Experiment: Exploring the /proc Filesystem 🎯 Aim: To use the /proc virtual filesystem to gather system information related to CPU, memory, and process statistics . Theory: The /proc directory is a virtual filesystem that provides an interface to kernel data structures . It does not contain real files on disk — instead, it provides real-time system information such as: CPU details Memory usage Process states Kernel parameters Each running process has its own directory under /proc (e.g., /proc/1 , /proc/2 , etc.), containing files that describe its current status. Tasks and Commands (a) Number of CPU Cores Command: grep -c ^processor /proc/cpuinfo Explanation: /proc/cpuinfo lists details of each logical CPU. Each CPU entry starts with the line processor : <number> . grep -c counts how many lines match processor , i.e., how many cores/logical CPUs are available. Sample Output: 4 ➡️ Means the system has 4 CPU cores . (b) Tot...
Comments
Post a Comment