In this chapter we will go through some of the basic commands in Linux. We will learn to list the contents of the folder, print the working directory, create a new file or directory, print a line of text, etc.
ls command
The ls command lists directory contents. If no directory is specified, the ls command will display the contents of the working directory.
The ls command lists directory contents. If no directory is specified, the ls command will display the contents of the working directory.
pwd command
The pwd command is used to print the path of the current working directory.
The pwd command is used to print the path of the current working directory.
mkdir command
To create a new directoy, we use the mkdir command. You must specify the name of the directory you are trying to create. If no path is specified, the directory is created inside the working directory.
To create a new directoy, we use the mkdir command. You must specify the name of the directory you are trying to create. If no path is specified, the directory is created inside the working directory.
We have created a folder called “my_folder” with the mkdir command. We have then displayed the content of the directory to make sure that the folder is created.
echo command
The echo command is used to to output text to the screen. You simply type the name of the command and then the text you would like to display.
The echo command is used to to output text to the screen. You simply type the name of the command and then the text you would like to display.
You might wonder what is the point of this command. Well, this command is very useful in scripts, which you will find out later when we get to the scripting.
whoami command
The whoami command displays the username of the current user.
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.
To change the current working directory we use the cd command. You must specify the path of the directory you would like to access.
Post a Comment