Wednesday, October 16, 2024

Linux Root Directory -additional command (pwd,ls,cd)

 

The first directory in the file system is called the root directory.

 

  • The root directory contains files and subdirectories, Which contains more files and subdirectories and so on.

  • cd / : it is used to go to the root directory in a linux.

     

  • Root directory is represented as forward slash ‘/’.

     

  • cd /root  : it is used to go to the root user’s home directory.

     

  • cd or cd ~  : if you want to exit from the root user account .

     Then follow these commands either cd or cd ~ .

     

  • Some important command:

     

  1. pwd: It is used to check your current working directory.

     

  2. cd: It is used to change the directory.

     

  3. ls: This command gives you the list of content of directory.