📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials Linux Command Line Navigating Directories

Navigating Directories

4 min read Quiz at the end
pwd shows your current location, ls lists files, and cd changes directory. cd .. goes up one level, cd ~ goes home, and cd - returns to the previous directory. Use ls -la to see all files with full details.

Moving Around

pwd            # print working directory
ls             # list files
ls -la         # detailed list with hidden files
cd /var/www    # go to absolute path
cd ..          # go up one level
cd ~           # go to home directory
cd -           # go to previous directory
Topic Quiz · 5 questions

Test your understanding before moving on

1. Which command shows the current directory?
💡 pwd (print working directory) displays the current absolute path.
2. cd ~ goes to:
💡 cd ~ or just cd navigates to your home directory.
3. ls -la shows:
💡 ls -la shows a detailed listing (-l) including hidden files (those starting with .).
4. What does cd .. do?
💡 cd .. navigates to the parent directory (one level up).
5. cd - takes you to:
💡 cd - navigates to the previously visited directory.