Linux and Command-Line Basics

Which of the following correctly describes the /proc directory on Linux?

  1. AIt is a write-protected place (for ordinary users) that collects the configuration files the kernel and services read at boot
  2. BIt is where device files are placed, which represent devices such as hard disks, USB drives and terminals so that they can be read and written like files
  3. CIt is a virtual file system through which the kernel shows running processes and the system state as files; its contents are not stored on disk
Show answer and explanation

Answer: C. It is a virtual file system through which the kernel shows running processes and the system state as files; its contents are not stored on disk

/proc is a virtual file system called procfs: each time a file is read, the kernel generates the information as of that moment. cat /proc/cpuinfo shows the CPU model and number of cores, cat /proc/meminfo shows memory usage, and /proc/<process ID>/ holds information on each process. Because the files do not exist on disk, many of them are shown with a size of 0. It is also often used on servers that run EDA tools, to check the number of CPU cores and the amount of memory.

  • A. Configuration files are kept in /etc. /proc is not a place for storing files.
  • B. Device files are kept in /dev (/dev/sda, /dev/null and so on).
  • C. Correct. It is a virtual file system whose contents the kernel generates each time they are read.
Practice this topic Back to topic

Books on Linux and Command-Line Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Linux and Command-Line Basics questions

  1. The directory /home/alice/data exists, and the current directory is /home/alice/work. Which of the following is the directory shown when "cd ../data" is run and then "pwd"?
  2. In the home directory, "ls" shows only notes.txt, while "ls -a" shows ".", "..", ".bashrc" and "notes.txt". Which of the following correctly explains this result?
  3. When the commands above are run in order, which of the following is the result of the last two cat commands?
  4. A directory contains six files: a1.txt, a2.txt, a10.txt, b1.txt, c1.txt and a1.csv. Which of the following is the number of files shown when "ls [ab]?.txt" is run in this directory?
  5. After "chmod 754 run.sh" is run on the file run.sh, which of the following is the permission notation shown at the start of the line from "ls -l run.sh"?