Basic linux commands we should know to start using a terminal

Hidden Night
1 min readApr 27, 2022
example of a terminal screen

Some of the basic linux commands are cd, pwd, mkdir, rmdir, ls, exit.. Let's learn what is the uses of each of these commonds.


cd command is used to change the working directory. Simply typing cd (or cd ~)will change the working directory to our home directory. cd followed by a hyphen (cd -) is used to go back to the previous directory. To change directory type cd followed by the path of the directory after a space.


pwd command is used to show present working directory.


To create a new directory. For eg mkdir dir1 will create a directory named dir1 inside the present directory.


To remove or delete a directory.


rm command is used to remove files. We can use rm -r to remove a non empty directory.


ls command is used to list the contents of a directory. ls -a is used to list all files including the hidden files(whose filename start with a .).


exit command is used to exit from the terminal.