Open a Linux or macOS terminal, run ls /, and you get a short list of strangely named folders: bin, etc, var, usr. They look random. They are not. Every one has a job, and once you know them, finding a config file, a log or a program stops being guesswork.
It is one big tree
Unlike Windows, which has separate drives such as C: and D:, Unix-style systems have a single tree. The top of it is called the root directory, written as a single forward slash: /. Everything else, every file, folder and even external drive, lives somewhere underneath it.
This is typical output on a Linux server. Your own machine may show a slightly different list.
The folders you will actually meet
| Directory | What it is for |
|---|---|
/ | The root of the whole tree. |
/bin | Essential programs (binaries) the operating system needs, such as ls, cp and mkdir. See how the shell finds them. |
/boot | Files used to boot the system. Leave it alone. |
/dev | Devices appear here as files: disks, terminals and special ones like /dev/null. |
/etc | System-wide configuration files. |
/home | Each user's personal files, one folder per user. |
/lib | Shared libraries that programs rely on. |
/tmp | Temporary files, usually cleared on reboot. |
/usr | Software and programs installed for users, with its own bin and lib inside. |
/var | Variable data that keeps changing: logs, caches, queues. |
Two practical examples: if a web server is misbehaving, its logs are usually under /var/log, and its settings are usually under /etc.
Your home folder, and the ~ shortcut
A computer can have many users, and each one's personal files go under the home directory. On most Linux systems that is /home/yourname. On macOS the same idea is called /Users/yourname.
You almost never type that full path, because the shell gives you a shortcut: the tilde, ~, always means your own home folder.
cd ~
pwdSo you now know the two most useful symbols in the filesystem: / is the root of everything, and ~ is your home.
macOS vs Linux, quickly
- macOS puts users in
/Users, not/home. - External drives on macOS show up under
/Volumes; on Linux you will usually find them under/mediaor/mnt. - Both are Unix-style, so
/bin,/etc,/usr,/tmpand/varwill feel familiar on either.
Where to go next: absolute and relative paths
Knowing the map is half of it. The other half is telling the shell where you want to go. /home/shobhan/notes.txt is an absolute path because it starts at the root. notes.txt or ../notes.txt are relative paths because they start from where you currently are. We explain that clearly, with diagrams, in Absolute vs relative path in Linux. Permissions on these folders are the next piece, covered in Linux file permissions explained.
Key takeaways
- ✓Unix-style systems have one tree. Its top is the root directory, written as /.
- ✓bin holds essential programs, etc holds configuration, home holds user files, var holds changing data like logs, tmp holds temporary files.
- ✓~ is a shortcut for your own home folder: /home/name on most Linux systems, /Users/name on macOS.
- ✓Names differ between distributions and macOS, so learn the idea behind each folder rather than one exact list.
Learn the terminal properly, once
CLI Mastery is 57 short lessons that take you from "what is a shell" to scripting and running a web server on AWS. Every idea is drawn first, then done live. Lifetime access, and three lessons are free to watch.
