Linux command lines may look initially out of the comfort zone for beginners, but as one start learning, it becomes the obvious choice for performing tasks, mostly for remote login and troubleshooting purposes. So what are Linux commands? Commands are the user input tasks in the Terminal of a Linux OS.
To start with, here are the 10 basic commands that you need to know.
ls command lists the contents of the directory. The below screenshot shows the ls command in use to display the folders in the top level of my Manjaro Linux PC.
cd (change directory) command is used to navigate into the directory. It is similar to clicking through a folder by using mouse. Additionally, cd [dir] – Changes the current directory to dir.
cd [directory name]
Use of cd without specifying a directory is a quick way of returning to a home directory if you were deep inside a directory. See below example.
pwd command displays the present working directory name. Use this command to know what directory you are in. See below example.
man command shows the manual for the command. For instance ‘man cd’ shows what’s the use of cd command. Type q to quit viewing the manual page.
clear command simply clears the terminal screen. Use it when there is too much in terminal than you can handle.
mkdir command allows the user to make a new directory. It’s just like right-click and creating a new folder in the file explorer (GUI way). Usage is shown below:
locate command is like search and find. You can use wild characters to locate a file. Note that the command is highly case-sensitive. Therefore search the file keeping this in mind. Here is an example:
rmdir command deletes the directory you specified. For example, to delete the directory ‘mytempfolder’ created in 6, use the following command:
exit command in Terminal is used to close the terminal.
echo displays arguments on screen. Here is its usage example:
Hope you enjoyed knowing all these basic Linux commands. Try using them whenever possible.