Linux’s organized directory structure (Credit: Wikipedia)
What is a Filesystem?
A filesystem is like a library’s organization system for your computer. It controls how data is stored and retrieved on your disk. Linux uses a hierarchical, tree-like structure starting from the root directory (/
), with all other directories branching out from it.
Key Directory Structure
Here’s a simplified overview of essential directories:
-
/
(Root)
The base of the entire filesystem. Every file/directory starts here. -
/bin
(Binaries)
Contains essential command-line tools likels
,cp
, andbash
.
-
/home
Personal folders for users. Your documents, downloads, and settings live here.
(e.g.,/home/alex
) -
/etc
(Configuration Files)
Stores system-wide settings (network config, user accounts, etc.). -
/var
(Variable Data)
Holds changing data like logs (/var/log
) and website files (/var/www
). -
/dev
(Devices)
Contains hardware device files (e.g.,/dev/sda
for your disk). -
/tmp
(Temporary Files)
Stores short-lived files deleted on reboot.
Popular Linux Filesystem Types
Type | Best For | Features |
---|---|---|
ext4 | General use | Default on most distributions |
XFS | Large files | High performance for big data |
Btrfs | Snapshots | Built-in backup/restore features |
Basic Navigation Commands
Try these in your terminal:
pwd # Show current directory
ls # List files in current folder
cd /etc # Switch to the /etc directory
tree -L 2 # Display directory structure (install with `sudo apt install tree`)
Basic Linux terminal commands (Credit: How-To Geek)
Why This Structure?
Linux’s organization prevents chaos by separating system files (/bin
, /etc
) from user data (/home
). This improves security, makes debugging easier, and allows efficient system updates.
💡 Tip: Use man hier
in your terminal to explore the full directory hierarchy documentation!
Ready to explore? Open your terminal and start navigating with cd
and ls
! Remember: Linux won’t let you accidentally delete critical system files without root permissions 😊.