Directory Navigation in the Linux Terminal

Learn how to move around your Linux filesystem like a pro! This page will cover the essential commands and tips for navigating directories in the terminal.
pwd
— Print your current working directoryexample: pwd /home/user/Documents will print the current working directory this means the terminal will show the path to the current directory. This is useful to know where you are in the file system.
ls
— List files and folders in the current directoryexample: ls will list the files and folders in the current directory. This is useful to know what is in the current directory.
cd
— Change directoryexample: cd /home/user/Documents will change the current directory to the Documents directory. This is useful to navigate to a specific directory.
cd ~
— Go to your home directoryexample: cd ~ will change the current directory to the home directory. This is useful to navigate to the home directory.
cd ..
— Move up one directoryexample: cd .. will move up one directory. This is useful to navigate up one level in the file system. say you are in the Documents directory and you want to go up one level to the home directory you would use cd ..
cd -
— Go to the previous directoryexample: cd - will go to the previous directory. This is useful to navigate back to the previous directory. So if you are in the Documents directory and you want to go back to the home directory you would use cd -
ls -l
— List with detailsexample: ls -l will list the files and folders in the current directory with more details. This is useful to know what is in the current directory and more details about the files and folders.
ls -a
— Show hidden filesexample: ls -a will list the files and folders in the current directory with hidden files. This is useful to know what is in the current directory and hidden files.
ls -la
— List with details and hidden filesexample: ls -la will list the files and folders in the current directory with more details and hidden files. This is useful to know what is in the current directory and more details about the files and folders and hidden files.