Linux CLI HowTo 2 🐧 Navigate Linux Filesystem Like a Pro
2 – How-To: Navigate Linux Filesystem Like a Pro
How to Find Your Current Location in the Filesystem
Steps:
- Open terminal
- Type
pwdand press Enter - Terminal displays current path (e.g.,
/home/username)
Why: Shows exactly where you are in the directory tree structure
How to Move to Root Directory
Steps:
- Open terminal
- Type
cd /and press Enter - Verify with
pwd
Why: Accesses the top-level directory that contains all other directories
How to List All Files Including Hidden Ones
Steps:
- Open terminal in desired directory
- Type
ls -laand press Enter - View results showing hidden files (starting with .)
Why: Reveals system files, configuration files, and hidden directories
How to Go Back to Your Home Directory Quickly
Steps:
- Open terminal from anywhere
- Type
cdand press Enter (orcd ~) - Verify with
pwd
Why: Fast way to return to personal user space regardless of current location
How to Access Another User’s Home Directory
Steps:
- Open terminal
- Type
cd ~usernamewhere username is the target user - Press Enter
- If successful, you’ll be in their home directory
Why: Useful for system administration or accessing shared user data
How to Navigate Up One Level in Directory Tree
Steps:
- Open terminal in subdirectory
- Type
cd ..and press Enter - Verify with
pwd
Why: Moves you to parent directory, useful when exploring nested folders
How to Go Back to Previous Location
Steps:
- Open terminal
- Type
cd -and press Enter - You’ll return to last working directory
Why: Quick way to switch between two locations without remembering paths
How to Check What’s in Your Home Directory
Steps:
- Open terminal
- Type
ls -la ~and press Enter - View all files including hidden ones in home directory
Why: Shows complete user environment including system configuration files
How to See Hidden Files in Current Directory
Steps:
- Open terminal in target directory
- Type
ls -aand press Enter - Notice files starting with dots (hidden files)
Why: Reveals important configuration files that aren’t normally visible
How to Navigate to Specific Deep Directory Path
Steps:
- Open terminal
- Type
cd /home/username/documents/work/projectsand press Enter - Use
pwdto confirm location
Why: Direct access to deeply nested directories without multiple steps