One big tree
On Windows you have drives like C:\ and D:\. Linux has no drive letters. Instead, every file and folder lives in a single tree that starts at the root directory, written as a single slash: /.
Here is a small part of the tree on our lab machine:
/ ├── bin programs (commands) everyone can run ├── etc system settings ├── home the users' home folders │ └── student your home folder ├── root the administrator's home folder ├── tmp temporary files ├── usr installed programs and their files └── var data that changes: logs, caches, mail
Folders are usually called directories on Linux. The two words mean the same thing.
Think of it like this: Think of the file system as a tree turned upside down.
/is the trunk at the top. Each directory is a branch, and files are the leaves at the ends of the branches.
Paths
A path is the address of a file: the list of directories you go through to reach it, separated by /. Your home folder's path is:
/home/student
Read it from left to right: start at the root /, go into home, then into student. A file called notes.txt inside it has the path /home/student/notes.txt.
Your home directory
Every user has a home directory for their own files, normally /home/<username>. When you open a terminal, you start there. The shell uses the short name ~ (tilde) for it, which is why the prompt shows ~.
Names are case-sensitive
Notes.txt, notes.txt and NOTES.TXT are three different files on Linux. And as you saw in module 1, files whose names start with a dot are hidden.
Tip: File names can contain spaces, but they make typing commands harder. Linux users prefer
my_notes.txtormy-notes.txttomy notes.txt.
Remember: Everything starts at
/. A path like/home/student/notes.txtis the address of a file.~is your home directory.