linux_directories

Default Linux Directories Explained

Linux has a Standard Directory hierarchy called File Hierarchy Standard (FHS) that defines the purpose and contents of Directories in Linux. FHS has a set of guidelines that defines the structure and contents of the directories on Linux based systems. FHS specifies the location and the purpose of the files and directories within the file system to ensure that software developers and system administrators can find what they need and that applications can run reliably across different Linux distributions. Find the default Linux directories below based in the FHS. you can find these directories in almost all Linux distributions.

Default Linux Directories

Directory Comments
/This the Root Directory in Linux File System
/binDirectory Contains binaries (programs) that must be present for the
system to boot and run.
/bootContains the Linux kernel, initial RAM disk image (for
drivers needed at boot time), and the boot loader.
Interesting files:
● /boot/grub/grub.conf or menu.lst, which
are used to configure the boot loader.
● /boot/vmlinuz, the Linux kernel
/devThis is kind of drivers folder, This is s special directory that contains device nodes. Here is where
the kernel maintains a list of all the devices it understands.
/etcThe /etc directory contains all of the system-wide
configuration files. It also contains a collection of shell
scripts which start each of the system services at boot time.
Everything in this directory should be readable text.
Interesting files: While everything in /etc is interesting,
here are some of my all-time favorites:
● /etc/crontab, a file that defines when
automated jobs will run.
● /etc/fstab, a table of storage devices and their
associated mount points.
● /etc/passwd, a list of the user accounts
/homeIn normal configurations, each user is given a directory in
/home. Ordinary users can only write files in their home
directories. This limitation protects the system from errant
user activity.
/libContains shared library files used by the core system
programs. These are similar to DLLs in Windows.
/lost+foundEach formatted partition or device using a Linux file system,
such as ext3, will have this directory. It is used in the case of
a partial recovery from a file system corruption event.
Unless something really bad has happened to your system,
this directory will remain empty.
/mediaOn modern Linux systems the /media directory will
contain the mount points for removable media such as USB
drives, CD-ROMs, etc.
/mntOn older Linux systems, the /mnt directory contains mount
points for removable devices that have been mounted
manually.
/optThe /opt directory is used to install “optional” software.
This is mainly used to hold commercial software products
that may be installed on your system.
/procThis is a special directory that provides information about the system and its processes. It is a virtual file system that is maintained by linux kernel, and it doesn’t store any information in Physical file storage. The /proc directory contains directories and files tha expose information about the running processes, system resouces, hardware configuration, and other kernel-related information.
/rootHome Directory for Root account
/sbinThis directory contains System binaries, These are
programs that perform vital system tasks that are generally
reserved for the superuser.
/tmpThe /tmp directory is intended for storage of temporary,
transient files created by various programs. Some
configurations cause this directory to be emptied each time
the system is rebooted.
/usrThe /usr directory tree is likely the largest one on a Linux
system. It contains all the programs and support files used
by regular users.
/usr/binThis directory contains the executable programs installed by your Linux distribution.
/usr/libThe shared libraries for the programs in /usr/bin.
/usr/localThe /usr/local tree is where programs that are not
included with your distribution but are intended for systemwide use are installed. Programs compiled from source code
are normally installed in /usr/local/bin. On a newly
installed Linux system, this tree exists, but it will be empty
until the system administrator puts something in it.
/usr/sbinThis directory contains more system administration programs.
/usr/shareThis directory contains all the shared data used by programs in /usr/bin. This includes things like default
configuration files, icons, screen backgrounds, sound files,
etc.
/usr/share/docMost packages installed on the system will include some
kind of documentation. In /usr/share/doc, we will find
documentation files organized by package.
/varThe /var directory tree is where
data that is likely to change is stored. Various databases,
spool files, user mail, etc. are located here.
/var/log/var/log contains log files, records of various system
activity. These are very important and should be monitored
from time to time. The most useful one is
/var/log/messages. Note that for security reasons on
some systems, you must be the superuser to view log files.

Read Also:

How to Add Kali Linux to Windows Terminal Profile?

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top