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 /
$ ls
Linux file system Hierarchy
Linux File system Hierarchy

Linux File System Diagram

A standard Linux distribution follows the directory structure as shown below.

Linux File System Hierarchy Diagram
Linux File System Diagram

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.

/usr: It contains all the user binaries, their documentation, libraries, header files, etc. it also contains programs like telnet, FTP, etc.

/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.

If You Love
this article, You Should Consider:

  • Like us on Facebook
  • Follow us on Instagram
  • Follow us on Twitter
  • Let us know your suggestions and queries in the comments below.
  • Subscribe to our Newsletter

Thank you for your Love and Support

  • Anders Jackson

    /lost+found is created when the file system is created, not when Linux is installed. So you can find that in each file systems root, wherever that is mounted in the file system.

  • Anders Jackson

    /root is the home direcrory of the root user, which is used by system administrators. Because it has no restriction in access of the OS resources.

  • Anders Jackson

    In /usr you also find bin, lib, man, share and local, to mention some important directories.

    In /usr/local your system administrator can instal software that are not part of the distribution. So ther is also a bin, lib, man and share libraries, like in / and /usr.

    /opt is used by comercial and other software that is not localy compiled, like the ones in /usr/local.

    /srv you put data for servers that are running. Like data areas for samba, nfs, Web servers etc. That will make it easier to back up the important data.

    In /var/www the Web server have default installation of sites data. But if you want to run a Web server for real, you set it up to stor Web site data under a directory like /srv/www/mainsite/,0. So if your package with Web server is removed, the data will be left and not removed too.

  • Pingback: How to Install and Configure Django Python Framework on Ubuntu()