When you open a Linux terminal for the first time, you might see something like:
/home/username $
or sometimes:
~ $
At first, this can be confusing.
π What is /?
π What does ~ mean?
π Who is username?
π And what is this βrootβ everyone talks about?
Letβs understand all of this step by step in a simple way.
π³ Linux Does Not Use C:, D: Drives
In Windows, files are organized into drives like C:, D:.
Linux works differently.
π It uses a single filesystem structure that starts from:
/ β Root Directory
This is the top-most directory in Linux.
Everything exists inside /.
/
βββ home
βββ bin
βββ etc
βββ usr
Think of / as the starting point of the entire system.
π§ What is username? (Users in Linux)
Linux is a multi-user system, meaning:
Multiple users can exist on one system
Each user has their own space
When a user is created, Linux automatically creates:
/home/username
π This is the home directory of that user.
π What is ~?
Instead of writing the full path:
/home/username
Linux provides a shortcut:
~
π ~ represents the current userβs home directory
So:
cd ~β goes to homepwdβ shows/home/username.
π Understanding βrootβ (Very Important)
This is where many beginners get confused.
There are two meanings of βrootβ in Linux:
/ β Root Directory Top of the filesystem Everything starts from here
root β Root User (Administrator) A special user with full control Can access and modify anything in the system.
Its home directory is:
/root
β οΈ Important:
/β/root/β whole system/rootβ admin userβs home
Important Directories
π¦
/binβ Basic Commandsπ Command:
ls /bin | headπ Output:
bash cat cp ls mkdir mv rm touchπ These are basic commands used daily.
βοΈ
/sbinβ System Commandsπ Command:
ls /sbin | headπ Output:
reboot shutdown mount fsck ifconfigπ Mostly used by admin.
π
/usrβ Installed Programsπ Command:
ls /usrπ Output:
bin lib shareπ Check programs:
ls /usr/bin | headπ Output:
python3 node gcc git vim
These are installed tools.
π /home β Users
π Command:
ls /home
π Output:
user1
user2
π Enter a user:
cd /home/user1
ls
π Output:
Documents
Downloads
Pictures
π /etc β Configuration
π Command:
ls /etc | head
π Output:
passwd
hosts
hostname
group
π View users:
cat /etc/passwd | head
π Output:
root:x:0:0:root:/root:/bin/bash
user:x:1000:1000::/home/user:/bin/bash
π Shows user details.
ποΈ /tmp β Temporary Files
π Command:
cd /tmp
touch demo.txt
ls
π Output:
demo.txt
π File may disappear after reboot.
π /var β Logs
π Command:
ls /var/log | head
π Output:
syslog
auth.log
kern.log
π View log:
cat /var/log/syslog | head
π Output:
May 1 10:00:01 system started
May 1 10:01:22 login success
π /dev β Devices
π Command:
ls /dev | head
π Output:
null
tty
sda
random
π Represents hardware.
β‘ /proc β System Info
π Command:
cat /proc/cpuinfo | head
π Output:
processor : 0
vendor_id : GenuineIntel
cpu MHz : 2400.000
π Memory:
cat /proc/meminfo | head
π Output:
MemTotal: 8000000 kB
MemFree: 2000000 kB
π§ Key Takeaways
/is the root directory~is home directoryLinux supports multiple users
Each directory has a purpose
Commands help explore everything
β οΈ Common Mistakes
Confusing
/and/rootRunning dangerous commands
Ignoring system structure.