Navigation
Navigating Directories
Section titled “Navigating Directories”Each directory is represented by a path:
.
→ current directory..
→ parent directory~
→ user’s home directory/
→ root directory
Main Commands
Section titled “Main Commands”Command | Description | Example |
---|---|---|
ls | List the contents of a directory | ls |
ls -l | List with details (permissions, size, date) | ls -l |
ls -a | Include hidden files (those starting with . ) | ls -a |
pwd | Print the full path of the current directory | pwd |
cd | Change to a specified directory | cd Documents/ |
cd .. | Move to the parent directory | cd .. |
cd ~ | Change to the user’s home directory | cd ~ |
cd / | Change to the root directory | cd / |
Practical Example
Section titled “Practical Example”cd ~pwdls -la
Best Practices
Section titled “Best Practices”- Use
ls -la
to see all files, including hidden ones. - Verify your location with
pwd
before running sensitive commands. - Use the Tab key for autocompletion.