| Command | Purpose | Icon |
|---|---|---|
pwd |
Print Working Directory | ๐ |
cd |
Change Directory | ๐ถ |
ls |
List directory contents | ๐ |
# 1๏ธโฃ Check current directory
pwd
# Output: /home/user
# 2๏ธโฃ Go to home directory (all equivalent)
cd
cd ~
cd $HOME
# 3๏ธโฃ Go to root directory
cd /
# 4๏ธโฃ Go back to home directory
cd ~
# 5๏ธโฃ List current directory contents
ls
# 6๏ธโฃ List with details
ls -l
# 7๏ธโฃ List including hidden files
ls -la
user@localhost:~$ pwd
/home/user
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
Shows current location โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
user@localhost:~$ cd
user@localhost:~$ pwd
/home/user
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
Still in home directory โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
user@localhost:~$ cd /
user@localhost:~$ pwd
/
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
Now at root directory โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
user@localhost:~$ cd ~
user@localhost:~$ pwd
/home/user
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
Back to home directory โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Shortcut | Destination | Example |
|โโโ-|โโโโ-|โโโ|
| cd or cd ~ | ๐ Home directory | /home/user |
| cd / | ๐ณ Root directory | / |
| cd .. | โฌ๏ธ Parent directory | Up one level |
| cd - | โฉ๏ธ Previous directory | Last location |
| cd ~/Documents | ๐ Subdirectory of home | /home/user/Documents |
โ
Next: โ Essential File Commands
Previous: โ File System Permissions
Lesson Home: โ Lesson 2: The Shell
Course Home: โ Introduction to Linux