Posts

Showing posts with the label Procfs

Procfs

What is procfs all about? Procfs is a virtual file system in linux mounted in /proc, and serves multiple purposes including access to kernel information in userland or for debugging. One of the features which makes Linux special to me is access to process information as a text stream. A lot of linux commands (ps, top, pstree, etc.) rely on this filesystem for information. The virtual file system The files and directories of the /proc filesystem are virtual because the data is not actually stored on any sort of permanent storage like a hard disk; instead, the directories, files, and data within them are created dynamically in memory from raw kernel data whenever you attempt to read them. Mounting proc Check if you already have procfs mounted on your system ( grep proc /etc/mtab ), otherwise mount it using the following command: mount -t proc proc /proc Process information Each process has an entry in the   /proc   filesystem identified by its PID. The followi...