Linux filesystem structure
Think of your computer as a big tree, and the Linux filesystem is like the branches
and leaves of that tree. Each part of the tree has a special purpose and holds different things.
At the very bottom of the tree is the root, represented by "/". Just
like the roots of a tree, the root of the Linux filesystem is where everything starts. It is the main folder
that holds all other folders and files.
Now, let's look at some important branches of our Linux tree:
- /bin (Binaries): This branch
holds special files called "binaries" that make the computer do specific tasks. Binaries are
like tools that help the computer run different programs and perform actions. if you created a program
that do a specific task you can move it to the /bin directory so you can execute it from terminal with
just typing its name
- /etc (Etcetera): This branch
has important files that control how the computer works. It keeps settings and configurations for
various programs and system functions.
- /var (Variable): This branch
holds files that can change or vary as we use the computer. For example, it keeps files related to
ongoing tasks, temporary data, and system logs.
- /usr (User): This branch is
like a big folder for all the extra things we install on the computer. It holds programs, libraries, and
other files that users can use.
- /boot (Boot): This branch contains
special files that help the computer start up when you turn it on. It's like the roots of the tree
that support the computer's initial start.
- /dev (Devices): This branch
represents all the devices connected to the computer, such as the keyboard, mouse, or printer. It's
like the branches where different devices grow and connect to the tree.
- /home (Home): This branch is
like a special place for each person who uses the computer. It has separate branches for each user,
where they can store their files, pictures, and personal things.
- /lib (Library): This branch
holds important files called libraries that other programs need to work correctly. Think of libraries as
books that programs can borrow to do their tasks effectively.
- /lib32, /lib64, /libx32: These
branches are like special library sections for different types of computers. They hold the right books
(libraries) that programs need to run on different computer types.
- /lost+found (Lost and Found):
This branch is like a special area where the computer puts files that it found in unexpected places or
that got lost. It's like a place where the computer keeps things it wants to return to their
rightful spots.
- /media (Media): This branch is
where the computer puts removable devices like USB drives or CDs.
- /mnt (Mount): This branch is
where you temporarily attach or "mount" other storage devices, like external hard drives or
network drives. It's like adding extra branches to our tree to hold more things.
- /opt (Optional): This branch
is for special software or programs that you choose to add to the computer. It's like a branch where
you can place extra tools or toys that you want to use.
- /proc (Process): This branch
provides information about what the computer is doing right now. It's like a branch where you can
see and understand how the tree (computer) is working.
- /root (Root): This branch is
like the main branch of the tree. It's the home of the most powerful user called "root"
who can do anything on the computer. It's like the trunk of the tree that holds everything
together.
- /run (Run): This branch holds
temporary files and information that the computer needs during its current session. It's like a
branch where the computer keeps things it needs for its ongoing tasks.
- /sbin (System Binaries): This
branch holds important programs that only the system administrators use to manage and control the
computer. It's like a branch where special tools for tree caretakers are kept.
- /srv (Service): This branch is
used to store data and files for services or programs that the computer provides to others. It's
like a branch where the tree shares its fruits with other creatures.
- /sys (System): This branch
provides information and settings about the computer's hardware and devices. It's like a branch
that tells us about the tree's internal structure and helps it function properly.
- /tmp (Temporary): This branch
is like a temporary playground where programs can leave their files for a short time. It's like a
branch where things are put for immediate use and not meant to stay for long.
Imagine the leaves on the branches of our tree as files and smaller folders that
store different types of information. They can be documents, pictures, music, or even more folders.
Each part of the Linux filesystem has its own special purpose, just like each
branch of a tree. They all work together to make the computer function properly and help us do things like
writing, and surfing the internet.