Essential Linux commands

In this lesson we will cover the essential commands in Linux. We will learn how to list the content of a directory, print the working directory, create a new file or directory, print a line of text, etc.

ls command
The ls command lists the directory content. If no directory is specified, the command will display the content of the working directory.

linux ls command

pwd command
The pwd command is used to print the path of the current directory.

linux pwd command

mkdir command
To create a new directoy, the mkdir command is used. You must specify the name of the directory. If no path is specified, the directory is created inside the working directory.

linux mkdir command

In the picture above you can see that we’ve created a directory called my_folder using the mkdir command. We have then displayed the content of the directory with the ls command.

echo command
The echo command is used to to output text to the screen. You simply type echo and then the text you would like to display.

linux echo command

whoami command
The whoami command displays the username of the current user.

linux whoami command

cd command
To change the current working directory we use the cd command. You must specify the path of the directory you would like to access.

linux cd command

Geek University 2022