Source: https://mysqlentomologist.blogspot.com/2021/01/linux-proc-filesystem-for-mysql-dbas.html

Proc

image

Julia Evans

image

image

Basically, the proc filesystem is a pseudo-filesystem which provides an interface to kernel data structures. It is commonly mounted at /proc:

/etc/issue is a text file which contains a message or system identification to be printed before the login prompt.

The cat /etc/os-release command displays the operating system’s name and version information on a Linux system

openxs@ao756:~$ cat /etc/issue
Ubuntu 16.04.7 LTS \n \l

mount displays a list of all currently mounted filesystems. The output typically includes the device, the mount point, the filesystem type, and mount options.

openxs@ao756:~$ mount | grep '/proc'
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
...

/proc is a temporary filesystem which linux initializes, in order to keep track of resources and states of each process, as well as system wide resources.

image

image

Every command line tool like ps,top,vmstat,free derives its results from parsing /proc directory.

image

image

Most of it is read-only, but some files allow to change kernel variables.

openxs@ao756:~$ ps aux | grep mysqld
...
mysql    30580  0.7  8.1 746308 313984 ?       Sl   Jan02   9:55 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid

So there will be the /proc/30580 directory with the following content:

image

Highlighted are the files and directories are more useful. Note also “Permission denied” messages above that you may get while accessing some files in /proc, even related to the processes you own. You may still need root/sudo access (or belong to some dedicated group) to read them.

image

image

tasks

image

cmdline

image

comm

image

coredump_filter

image

environ

image

fd

image

image

fidinfo

image

image

io

image

limits

image

maps

image

status

image

Process state

image

image

image