Basic Linux Tutorial
Computer Tutorial

Working with Directories



Working with Directories

pwd

The pwd commands display the present working directory or current directory.
Synopsis :
pwd [option]
Option
-l   display the content as absolute name
-p   print fully resolved name for the current directory

cd

The cd command can change the current directory
Synopsis :
cd [directory]
Example :
cd   /bin
Option
cd~   change to your home directory
cd/   change to root directory
cd..   change to parent directory
cd-   change to previous directory

ls

ls command is used to lists directory and files in an directory
Synopsis :
ls [option] [file/directory]
Example :
ls   -a
Option
–a   list all files including hidden files starting with ‘.’
–d   list directory
–l   list with long format
–r   list in reverse order
–s   sort by size
–t   sort by time and date
–x   sort by extension name
–R   list the file and folder of directory and sub directory