Now that our server is updated. Let's explore some of the file and directory commands.
First, is the
pwd command. This command gives us the "Present Working Directory". Type
pwd and press - enter.
We are presently in the root directory. The reason we are in this directory is because we logged in as the root user. By default, we are placed into the directory corresponding to our username.
Later we will create and login as another user.
The next directory command is the
ls command. This command gives us a list of files in our current directory.
ls and press enter. You will notice nothing was outputted. This is because the root folder is empty.
Let's navigate up one directory.
The command for that is
Now try the
ls command again, and see the output.
We can now see several folders, including our root folder.
We are currently in the home directory. We cannot go up past this directory.
To navigate to a specific directory type:
cd and then the name of the directory.
Let's go to the var folder.
We are now in the var folder.
A quick way to get back to the home directory from any folder, is the
cd / command, then type:
Our command console is filling up with command lines. To clear the console window, type
reset and press enter.
This clears the console, but doesn't delete your previous commands. Scroll up, and you will see all your previous commands are still there.
Those are the main commands we need to know for now. We will explore others as we progress through the lessons.