15 things you need to know about the Linux Directory Structure

Know the important Linux top level directories

In the second chapter of our ‘Learn Linux’ series, today we learn about the Linux Directory structure. Every operating systems have certain hierarchy of directory for organizing the files as a way to help users keep track of 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. Let’s take a look at each one of these directories.

1. Root /

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 anyway. 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 as “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 system administrator. Obviously system admin uses it for system maintenance purpose.

4. Boot Loader /boot

As the name of the folder 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 the place where all the configuration files required by all programs are stored. Each program will have a config file that is used to control the operation of a program including start or stop of the program. It is not an executable binary.

6. Home /home

Home directory has all users personal files. Inside it, each user account of the system will have a 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 that are needed to boot the system and run the commands in the 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 which is 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 which is used as an interface to kernel data structures. This file system stores text information about system resources.

12. Root /root

When a user sign 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 cleanup 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 are then 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.

 

Kiran Kumar
Hi there! I'm Kiran Kumar, founder of FOSSLinux.com. I'm an avid Linux lover and enjoy hands-on with new promising distros. Currently, I'm using Ubuntu as a daily driver and run several other distros such as Fedora, Solus, Manjaro, Debian, and some new ones on my test PC and virtual machines. I have a day job as an Engineer, and this website is one of my favorite past time activities, especially during Winter ;). When I'm not writing for FOSSLinux, I'm seen biking and hiking on scenic trails. I hope you enjoy using this website as much as I do writing for it. Feedback from readers is something that inspires me to do more and spread Linux love!. If you find a time, drop me an email or feedback from the 'Contact' page. Or simply leave a comment below if you found this article useful. Have a good day!

1 COMMENT

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

23,533FansLike
365FollowersFollow
16SubscribersSubscribe

LATEST ARTICLES

Top 10 Reasons to use Xfce as your Desktop Environment

There are many choices for desktop environments for Linux based operating systems. Mainly, you can install any DE of your choice on most of the Linux based distributions, even if they are not offered as a package officially. In our recent articles, we discussed the best of KDE and Cinnamon. In this article, we wish to present to you the top reasons why you should consider Xfce as your desktop environment.

The 10 Best Linux Network Monitoring Tools

Having total control over your network is essential to prevent programs from overusing your network resources and slowing down the overall performance. This is why you should install a network monitoring tool on your system, giving you a visual overview of everything that's happening on your network. Networking Tools are like swiss-knife for the system administrators for troubleshooting system issues.

How to install CouchPotato on Ubuntu

Downloading movies and copying them over to your home server can get frustrating, especially if you are doing it daily! What if you have an option to download videos automatically, quickly, and above all with excellent quality. CouchPotato allows you to download movies easily once they are available and released automatically.

Top 20 Rsync Examples in Linux

The Rsync (remote sync) command is a Linux/Unix utility used to synchronize and copy files and directories either locally or remotely. Most Linux geeks use Rsync to mirror, backup or migrate data across folders, across disks and networks. One notable feature with the Rsync command is that it uses the "delta transfer algorithm."

Setting up NFS Server on Ubuntu Server

We have put together a detailed step-by-step tutorial that will guide you on how to install and set up NFS Server on Ubuntu so you too can start sharing data with other client systems. It is divided into sections, the first part discussing how to set up the host server and the second part showing you how to set up the client-side. For this tutorial, we will be using Ubuntu 20.04 LTS.

Crontab in Linux Explained With Examples

Crontab is the Linux equivalent of the Window's Task Scheduler. It can help you set up a task to run automatically at a regular...

MUST READ

Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.
Elementary OS 5.1 Hera has received a point release with a handful of new features and bug fixes, and we will be reviewing the significant changes in this article. For those new to elementary OS, this Ubuntu-based Linux distribution uses their inhouse built Pantheon desktop environment and AppCenter.

10 Best Screen Capturing Software for Linux

Do you want to make a video tutorial for YouTube or show-off your epic victory royale to your friends? Look no further — as we have compiled the 10 Best Screen Capturing Software for Linux. Whether you need to record your desktop screen or take a simple screenshot, FOSSLinux has got your back.

Removing the Virus from a Windows PC with a Ubuntu Live USB drive

In this tutorial, we are going to show you how to clean your Windows machine from infected viruses using an Ubuntu live USB or CD and the ClamAV antivirus. The ClamAV is a free, open-source antivirus that can be used on Ubuntu.

5 Things to do when your Linux system GUI freezes

All operating systems freeze at some point and, Linux distributions are no exceptions. In this post, we are going to look at five methods you can apply to your frozen system before thinking of plugging out the power cable or holding down the power button to power off the PC.

VIDEO: MX Linux 19 Features and Desktop Tour

MX Linux is a Linux distribution based on Debian stable and using core antiX components. The distributions MX Tools is very popular among users and combined with other several ready-to-use tools, it is great for users who prefer to tweak their distro to their liking. In this video, we will take you through the features tour showing casing MX Linux 19.