Basic linux commands we should know to start using a terminal

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

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

pwd command is used to show present working directory.

mkdir

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

rmdir

To remove or delete a directory.

rm

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

ls

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

exit command is used to exit from the terminal.

 by the author.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store