What file under the proc directory contains information regarding what modules are currently loaded into the Linux kernal?
05 Jan 2020 Show
/proc directory is not a real filesystem, it is a Virtual File System. It contains information about processes and other system information. It is mapped to /proc and mounted at boot time. Running a ls in /proc lists a bunch of numbered directories and a bunch of files. The numbered directories are process PIDs and contains information related to the process. We can get information about what file contains man 5 /proc/ Quick description of some files
/proc/$ ls -l /proc/1 dr-xr-xr-x 2 root root 0 Jan 3 11:46 attr -rw-r--r-- 1 root root 0 Jan 5 09:29 autogroup -r-------- 1 root root 0 Jan 5 09:29 auxv -r--r--r-- 1 root root 0 Jan 3 11:46 cgroup --w------- 1 root root 0 Jan 5 09:29 clear_refs -r--r--r-- 1 root root 0 Jan 3 22:57 cmdline -rw-r--r-- 1 root root 0 Jan 3 11:46 comm -rw-r--r-- 1 root root 0 Jan 5 09:29 coredump_filter -r--r--r-- 1 root root 0 Jan 5 09:29 cpuset lrwxrwxrwx 1 root root 0 Jan 5 09:29 cwd -> / -r-------- 1 root root 0 Jan 3 11:46 environ lrwxrwxrwx 1 root root 0 Jan 3 22:57 exe -> /lib/systemd/systemd dr-x------ 2 root root 0 Jan 3 11:46 fd dr-x------ 2 root root 0 Jan 3 11:46 fdinfo -rw-r--r-- 1 root root 0 Jan 3 11:46 gid_map -r-------- 1 root root 0 Jan 5 09:29 io -r--r--r-- 1 root root 0 Jan 3 11:50 limits -rw-r--r-- 1 root root 0 Jan 3 11:46 loginuid dr-x------ 2 root root 0 Jan 5 09:29 map_files -r--r--r-- 1 root root 0 Jan 5 09:29 maps -rw------- 1 root root 0 Jan 5 09:29 mem -r--r--r-- 1 root root 0 Jan 3 11:46 mountinfo -r--r--r-- 1 root root 0 Jan 5 09:29 mounts -r-------- 1 root root 0 Jan 5 09:29 mountstats dr-xr-xr-x 5 root root 0 Jan 3 11:46 net dr-x--x--x 2 root root 0 Jan 5 09:29 ns -r--r--r-- 1 root root 0 Jan 5 09:29 numa_maps -rw-r--r-- 1 root root 0 Jan 5 09:29 oom_adj -r--r--r-- 1 root root 0 Jan 5 09:29 oom_score -rw-r--r-- 1 root root 0 Jan 3 11:46 oom_score_adj -r-------- 1 root root 0 Jan 5 09:29 pagemap -r-------- 1 root root 0 Jan 5 09:29 patch_state -r-------- 1 root root 0 Jan 5 09:29 personality -rw-r--r-- 1 root root 0 Jan 5 09:29 projid_map lrwxrwxrwx 1 root root 0 Jan 3 11:46 root -> / -rw-r--r-- 1 root root 0 Jan 3 11:46 sched -r--r--r-- 1 root root 0 Jan 5 09:29 schedstat -r--r--r-- 1 root root 0 Jan 3 11:46 sessionid -rw-r--r-- 1 root root 0 Jan 3 11:46 setgroups -r--r--r-- 1 root root 0 Jan 5 09:29 smaps -r--r--r-- 1 root root 0 Jan 5 09:29 smaps_rollup -r-------- 1 root root 0 Jan 5 09:29 stack -r--r--r-- 1 root root 0 Jan 3 11:46 stat -r--r--r-- 1 root root 0 Jan 3 12:07 statm -r--r--r-- 1 root root 0 Jan 3 11:46 status -r-------- 1 root root 0 Jan 5 09:29 syscall dr-xr-xr-x 3 root root 0 Jan 3 11:46 task -r--r--r-- 1 root root 0 Jan 5 09:29 timers -rw-rw-rw- 1 root root 0 Jan 5 09:29 timerslack_ns -rw-r--r-- 1 root root 0 Jan 3 11:46 uid_map -r--r--r-- 1 root root 0 Jan 5 09:29 wchan Print the contents of any file to see what it contains, $ cat /proc/1/status Name: systemd State: S (sleeping) Tgid: 1 Ngid: 0 Pid: 1 PPid: 0 TracerPid: 0 Uid: 0 0 0 0 Gid: 0 0 0 0 FDSize: 256 ... We can gather that the process with PID 1 has name systemd and its current state is sleeping. The user id (Uid) and group id (Gid) are 0, which means they belong to root user. The most common files inside a pid directory are
Reference
What file in the proc folder contains details about the CPU?The numbered directories represent processes, better known as PIDs, and within them, a command that occupies them. The files contain system information such as memory (meminfo), CPU information (cpuinfo), and available filesystems.
What is the proc directory in Linux?The /proc/ directory — also called the proc file system — contains a hierarchy of special files which represent the current state of the kernel — allowing applications and users to peer into the kernel's view of the system.
What can be found in the proc directory?This special directory holds all the details about your Linux system, including its kernel, processes, and configuration parameters. By studying the /proc directory, you can learn how Linux commands work, and you can even do some administrative tasks.
Which of the directory contains process and kernel information files?The /proc directory is a pseudo-filesystem containing information about processes and kernel parameters. It is populated with data during boot-up and is cleaned when you shut down your Linux machine. The /proc directory is also home to system information such as memory usage, processor information, and so on.
|