pwd(Present working Directory):

  • It shows the a user’s current working directory.
  • pwd always returns the absolute path. img_1

  • Absolute path: It is the full path starting from the top level path which is / to my current working directory. The absolute path will always start with / at the beginning.
  • Relative path: It is not a full path but rather a path which depicts the location relative to our own current working directory.
  • For example: we are in /home/user1 directory. To move upwards either we can write using the relative path like this → cd Desktop/ , or we can write using absolute path like this → cd /home/user1/Desktop/ img_2

img_3

To go back to home directory:

  • Use the command cd or cd ~ img_4

Switching between current and previous directories:

  • Command → cd - img_5

Viewing directory hierarchy:

tree command:

  • tree -a → Includes hidden files in the output. img_6
  • tree -d → excludes files from the output. img_7
  • tree -h → Displays file size in a human readable format. img_8
  • tree -f → prints the full path of each file. img_9
  • tree -p → prints file permissions in the output. img_10