Home Learn Linux 15 things you need to know about the Linux Directory Structure

15 things you need to know about the Linux Directory Structure

by Kiran Kumar
Published: Updated:
Linux Directory Structure

In the second chapter of our ‘Learn Linux’ series, today, we learn about the Linux Directory Structure. Every operating system has a certain hierarchy of directories for organizing the files to help users track where something can be found.

Take a look at the File Manager shown below. Each folder serves a defined purpose, most importantly the Security. Linux is typically safer than Microsoft Windows just because of the way Linux works within these system directories. So let’s take a look at each one of these directories.

1. Root /

The root directory is the beginning point for the file system hierarchy. Every single file and directory starts from the root directory. As the name suggests, only the root user has write privilege under this directory. But it’s important to note that “/” is not related to “/root” in any way. All the below-listed directories reside in the Root Directory.

Linux Directory Structure

Linux Directory Structure

2. User Binaries /bin

bin directory

bin directory in Manjaro Linux

The “bin” directory is home to all the executable programs. In Linux, the executables are termed “Binaries.” All commands used by the users of the computer are located here.

3. System Binaries s/bin

sbin directory

sbin directory Eg. Manjaro Linux

s/bin directory also contains binary commands just like /bin directory. The only difference is the Linux commands located under this directory are used by the system administrator. Obviously, the system admin uses it for system maintenance purposes.

4. Boot Loader /boot

As the folder’s name indicates, /boot folder contains boot loader-related files, including the important kernel, initrd, vmlinux, grub files, etc.

5. System configuration files /etc

etc directory

etc directory

This is the place where all the configuration files required by all programs are stored. Each program will have a config file used to control the operation of a program, including the start or stop of the program. It is not an executable binary.

6. Home /home

The home directory has all users’ personal files. Inside it, each user account of the system will have an individual directory, for instance, “kiran” in my system.

home directory

home directory

7. System Libraries /lib /lib64

System Libraries /lib

System Libraries

This folder contains library files needed to boot the system and run the commands in the binaries located under /bin and /sbin directories.

8. Devices /dev

/dev contains the files that are used by the USB devices attached to the computer.

9. Mount directory /mount

This is a temporary mount directory typically used by the system administrators for mounting the different file systems.

10. Optional add-on Apps /opt

/opt is for the installation of add-on application software packages. It is typically used for third-party software, which implies they are already pre-compiled.

11. Process Information /proc

The proc file system is a pseudo-file system that is used as an interface to kernel data structures. This file system stores text information about system resources.

12. Root /root

When a user signs in as the root user, there will be a separate home directory created.

13. Temporary space /tmp

Tmp directory is a temporary folder that will be periodically deleted. In fact, some Linux distributions clean up during each boot. The directory is used by the system programs for temporarily storing the data. For example, when you extract an archive, the contents are first extracted to the /tmp directory and moved to the location you provided.

14. User folder /usr

This folder is home to all user-related programs, libraries, and documentation. The sub-directories in /usr relate to those described in this article.

15. Variable data /var

Variable data like system log files reside here. These files get constantly modified depending on ongoing user and system tasks.

You may also like

2 comments

Adrián De la Torre Sánchez February 23, 2019 - 8:46 AM

Muito boas explicações para novos amantes do linux, sou muito novo no mundo do linux e gosto muito do Linux Mint 18.3 e agora 19.

Reply
grokker December 13, 2023 - 11:01 PM

When you write s/bin you probably mean /sbin, right?

Reply

Leave a Comment

fl_logo_v3_footer

ENHANCE YOUR LINUX EXPERIENCE.



FOSS Linux is a leading resource for Linux enthusiasts and professionals alike. With a focus on providing the best Linux tutorials, open-source apps, news, and reviews written by team of expert authors. FOSS Linux is the go-to source for all things Linux.

Whether you’re a beginner or an experienced user, FOSS Linux has something for everyone.

Follow Us

Subscribe

©2016-2023 FOSS LINUX

A PART OF VIBRANT LEAF MEDIA COMPANY.

ALL RIGHTS RESERVED.

“Linux” is the registered trademark by Linus Torvalds in the U.S. and other countries.