Navigating the filesystem in Linux using the terminal

pwd

The pwd command is used to print the current directory that you are in. The command always prints out the absoloute path.

cd

The cd command allows you to go to a different directory. For example, if you are currently in the Music directory and you want to go to the subdirectory Rick_Astley, all you have to enter in the terminal is cd Rick_Astley . Now you are in the Rick_Astley folder.

To go to the root of the file system.
$ cd /

To go to your home directory
$ cd ~

To go to previous working directory
$ cd -

Last Updated On: Fri Feb 16, 2024

Comment via Email

RSS Feed