Welcome back.
Here we are in our clinics machine, and it is time we finally learn how to use that mysterious tool
that is said to be the most important tool that we must master.
Don't worry, terminal is not difficult to use.
But before we get to open it and run a bunch of the commands, let us first define what terminal is.
Terminal is a program that allows us to interact with Linux operating system using different commands,
we can create files, delete files, create directories, run programs, set different tasks to execute,
and we can do many more things using it.
It is important you get used to it, especially if you never used it before, because if you're coming
from Windows or Mac OS, you probably are used to opening files or folders by clicking on different
icons and navigating like that.
For example, on Windows we usually open files by double clicking on an icon and it will open that folder.
And on Linux, we can actually do the same thing, so if we go right here and for example, I want to
open this home folder, I will double click on that folder and it will open the folder with all the
files inside of it.
But we don't want to be doing it like that.
Let us see how we can do it using terminal.
So let us close this first and we already know how to open terminal.
Right.
Click on desktop and click open terminal here.
First thing that we notice is username that we have right here and the host name that we have right
here, but we also noticed this slash desktop.
This means that our terminal process has opened inside of the desktop directory.
Does it always open there?
Nope, it only opened there because we told it to open there.
Remember, we.
Right.
Clicked on desktop and clicked open terminal here.
If we, for example, went to the home folder.
And right, click here, open terminal.
Hmm, it doesn't say home like it did in desktop.
It just gives us this way.
We minus sign.
Well, that sign in Linux means that you are in your home directory of your user and our user is called
Mr. Hacker.
So the director, a name should be at home.
Mr. Hacker.
And to check the directory name, we can type the command P.
W.D. If we press enter, it will give us the current directory in which our terminal process is running
and it is home.
Mr. Hacker.
And this simply stands for print working directory.
If we, for example, go to the folder once again, which is your home folder.
Mr. Hacker.
And we double click on documents, try to open terminal here.
So open terminal here.
This will open a second terminal and you will see right here that it says documents, but do we always
need to go to that folder and open terminal inside of that folder for it to be inside of this directory?
Of course not.
We can use a command called KDDI.
And you should be familiar with this command, since we already used it before.
Let us test it out.
Let's go to the documents directly from our home directory, so we'll just close the second terminal
and wait here we are inside of our home directory or slash home slash Mr. Hacker.
We know that inside of this directory, there is a documents directory since we managed to open it right
here and to navigate to this directory using a terminal, we can use the command CD and then the name
of the directory, which is documents.
We press enter, and here it is, we are in documents directory, if we type here, it will tell us
the current working directory slash home slash Mr. Hacker slash documents.
And for example, if he wanted to go one step or one directory back, if we can type documents, CD
and then two dots.
What this command will do is it will go one directory back, and if I typed up once again, we will
now be again in slash home slash Mr. Hacker directory.
So these two dots tell the terminal to go one directory back.
OK, great, but how can we know which subdirectories and files are in the home directory?
For example, if we knew there was documents that are directly in the folder because we opened it right
here, we didn't open it over terminal.
We opened it right here from our desktop.
Once we open it again, we can see all the folders and files inside of this home.
Mr. Hacker directory, but we didn't see these files inside of our terminal, so how can we lose them?
How can we see all of these files using a terminal so we know which directories are available inside
of this home?
Mr. Hacker directory to check files and folders in any directory we can use another familiar command,
which is Altez.
And the command stands for the list, so let's just test it out.
If we type it, press enter, here we are, we can see same folders and same files that we can see inside
of this window right here.
So what we did for now is we use a terminal instead of clicking on a bunch of files, a bunch of icons,
we now are doing all of that with our terminal.
Now that we know which folders are in this directory, if we can choose which folder we want to go to
and use the command to go there.
But let us go one directory back from this flash home slash, Mr. Hacker, to do that, we already know
we can type CD and then to that's.
And by the way, CD simply stands for Changing Directory.
Don't know if I mentioned that, but CD is changing directory.
And now we can see once we went one directly back, we are in the home directory.
If we type here.
We can see here is our Mr. Hacker directory that is containing these files right here.
Since we went one step back, we can only see Mr. Hacker directory, since this is the only folder inside
of this home directory.
Let's go one more step back.
If I type two dots once again, now I'm in the directory and it is called slash directory because it
is only specified as a Forbert slash.
And we can go more than that.
This is the main directory that has all of the other files and directories in the system if we try to
type code once again.
You will see it will still be in this directory and remember when I told you during Callisthenics installation
that we will shortly see slash home slash tampoe slash VA directories that occurred in one of the installation
questions?
Well, if I type s right here.
These are all just standard business directories and here is home from which we came from.
Here is Mark.
And here is the MP.
And a bunch of other directories, and these are all just standard Linux directories.
From here, you will notice that not all of it is same color.
This is because not all of the stuff we see here is the same thing, something is a directory, something
is a file, and for example, we cannot use CD comment onto a file.
We can only use it to go to another directory.
So if we try, for example, CD.
And I chose this file, so in it.
Hardy thought IMG and press enter.
This will not work, it will give us an error saying not to directory.
But if a type CD and then at sea, for example, which is this directory and press enter now, I will
be inside the ETSI directory and here I can type Altez to list all of the files inside of the ETSI directory.
And you will also notice that here we got a mixture of files and directories as well.
Directories are these dark blue names.
While files can be other colors depending on file type.
Usually they are white.
OK, great.
We learned the basics of navigating through the system and directories, using different commands.
Now, before we finish this video, here is a practice test.
Try returning to the desktop directory from this Etsy directory, using only the comments that we learned.
I will give you right now a few seconds and I will show you how to do it.
So try it out.
OK, don't worry, if you didn't get it, this will come with practice.
So here it is, how we can do it.
From the ATSE directory, we know that we must go back to the directory and in this directory we got
our home directory, we can check it out by typing Altez And inside of this home directory, we know
that we got the Mr. Hacker directory and the Mr. Hacker directory has the desktop directory.
So to navigate there, we can type CD home.
Here then type CD, Mr. Hacker type here once again to check out all of the available directories and
see the desktop.
And now we are on our test of the rectory once again, great, so practice a little bit with these commands.
This is nothing really too hard.
Just take some practice and you will get used to it pretty soon.
And in the next video, we're going to see how we can create files and folders using terminal as well
as we are going to see how we can run programs.
See you there.