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.
pwd command
The pwd command is used to print the path of the current directory.
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.
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.
whoami command
The whoami command displays the username of the current user.
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.