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 -laBest Practices
Section titled “Best Practices”- Use
ls -lato see all files, including hidden ones. - Verify your location with
pwdbefore running sensitive commands. - Use the Tab key for autocompletion.