Linux File System is one of the most important parts of Linux if you are a newbie and don’t know much about it then chances are higher that you will mess up things.
Locating the File System
You can locate the file System by using the terminal just type the following commands:
$ cd /
Linux File System Diagram
A standard Linux distribution follows the directory structure as shown below.
The above directories contain boot information, important configuration files, below we have explained briefly the purpose of each directory.
Linux File System Hierarchy
/bin: It contains executable binary program files which are required for the purpose of booting and repair along with the other contents, it also contains basic shell commands e.g ls, kill, tar, rm etc.
/boot: boot directory contains the files which are required for booting the Operating System including the Linux Kernel.
/dev: It contains device files for all the hardware devices on the machine eg: CD-ROM, CPU etc.
/etc: it contains all system related configuration files, a configuration file is used to setup initial settings or parameters to a computer program.
/home: Every time a new user has created a home directory in the name of the user is created in the home directory which contains other directories like desktop, documents, pictures etc.
/lib: it contains the Kernel modules and libraries essential for binary files in /bin and /sbin.
/lost+found: This directory is created while the installation of Linux, it helps in recovering files which gets broken due to unexpected shutdown.
/media: it is temporary mount directory created for removable devices.
/mnt: Temporary mount directory for file systems.
/opt: This directory is reserved for all those software and add-on packages which are not the part of the default system.It basically consists third party applications.
/proc: A virtual file system, it doesn’t contain ‘real’ files but runtime system information(e.g system memory, devices mounted, hardware configurations etc.).
/root: It is the root directory of System Administrator and not to be confused with “/”. “/” is the root directory of the whole system.
/run: This directory is designed to allow applications to store the data they require in order to operate. This includes process IDs, socket information, lock files and other data which are required at run-time.
/sbin: This directory contains binary files used by the system administrator, for system maintenance and administrative tasks.
/srv: This folder contains server specific and service related files.
/sys: Modern Linux distributions include a /sys directory as a virtual filesystem. It stores and allows modification of the devices connected to the system.
/tmp: It stores temporary files for users and system, till next boot.
/var: It contains variable data like system logging files, mail, printer spool directories and transient and temporary files.
Some important files of Linux File System
/var/cache: contains application programs cache.
/var/game: variable data related to games.
/var/crash: This directory holds system crash dumps.
/proc/cpuinfo: contains CPU Information.
/proc/cmdline: contains command line arguments.
/proc/filesystems: Information of currently used file system.
/proc/interrupts: Information about the current interrupts.
/etc/rec: it contains script or directories of scripts to run at startup level
/etc/passwd: it is a user database containing information about each user such as username, password(in a shadow file), home directory etc.
/etc/login.def: configuration file for the Login command.
/boot/vmlinuz: The Linux Kernel
/lib/modules/’kernel-version’: This directory contains all the kernel modules.