Hello and welcome to this. Cali fundamentals lesson.
I'm your host Robert Smith, and I'm excited to
be here with you today. So you may be wondering when
are we going to get started? We've talked about downloading we've
talked about some history behind Cali we've
talked about all these different things. So when am I going to start learning
how to actually use Cali? Well, the
good news is today's lesson involves getting
around with the terminal and we're going to start inching our
way into Cali Linux the environment the file
systems things of that nature and it all starts here.
So today's lesson objectives are
pretty straightforward. I want you to walk away with a few navigation commands
a basic understanding of of how
to use the terminal how to get around how to
view files and things of that nature. We're not going to get into anything too
technical, but I'm going to give you some tools so
that you can start, you know, kick in the tires and really understanding,
you know, what's there and how to get through everything?
So what I'm going to do is pull up my lab
environment. Now, this is the Cali system
in the host data Integrity baselining lab.
So if you have access to that lab you can pull
this up and follow along with me or if you've already installed
a copy of Cali you can go from there as well. And you
know again, there's some differences like there might be the terminal button that's
up here in this version would maybe
be over here on the side and the version that you've previously downloaded.
So with those things in mind, let's go
ahead and jump into looking at the terminal so it's pretty pretty
straightforward when you click the terminal button you
get a terminal now what you may be
wondering is that's all fine and nice, but where do I begin? How
do I understand how to use this? Well, quite simply one step at
a time, right? So when you first open a
terminal the thing I like to do is what's called
print working directory or PWD what that
does for me? It's it's going to show me my current directory
and where I'm at with respect to the
File system and thinks of that nature. So typically this is where you'll
start off unless you were doing something else.
And you may be wondering. Well, that's neat, but I'm used
to a gooey. I can usually see what's in that directory. So,
how do I know? What's there now? Well if you use the
list command or LS for short
You'll notice that I have desktop which is the desktop folder and
that's neat as well. Right? So with these
two commands, you can really understand where you're
at within the file system or within this current terminal
session and you can get a listing of everything that's kind
of in that current directory that you're working within
so that's pretty easy pretty simple.
Now let's say that you need to go back
a directory or you need to go back a level
here. So the command change directory or
CD here. You can do that
with two dots and now you notice that
there's a slight change here.
When I hit LS or PWD first so
that we stay on track with that. You'll notice that I don't have anything there.
It's just blank but when I do LS list
We get a whole different set of
directories here. Now, you'll notice there's root that we
were just in there, right? So we went back one
and now we're in a directory that
is
Again, the kind of root of the whole system
here. So now if I need to get into any of
these other areas, you might be wondering what I didn't
mean to go here. I need to go back into root. How
do I do that? Well with that same command
we can type root.
instead of the two dots
and now we're back in the root folder.
So as you start working through
and you start, you know, navigating you can go
to different areas. So let's do it kind of quick here. So CD and
the two dots
We're back in that folder again or that directory.
We then do LS and now we can see something else.
Let's say I want to go into the Etsy
folder or the ETC folder. I just do the same thing CD Etc.
and
PWD and now we're working out of that particular area
LS and there's a lot more here.
We're moving a little fast on that. But again, it's just
some basic navigation commands. So print working directory
shows us where we're at.
LS shows us the content of that particular directory.
CD allows us to move through or back to certain
areas and just say that I'm ready to get back
to the root folder that I was originally in. I can just
type CD and hit enter.
And suddenly I'm back where I started very nice.
So we've entered all of these different things and we've
gotten all this different output and we're starting to get a bit of a mess here. So the
next thing that I I would like to show you is called clear. So
when I take clear and hit enter,
It gets rid of all that mess and now I've got a nice clean starting
point. So we were talking earlier about
the different directories and whatnot. And in your
root directory you have the desktop. So if you
want to you can hit CD.
type desktop
and bam, we're there now keep in mind
that if you want to quickly finish the name of something or
maybe you're having some confusion on remembering like let's say
that I'm back in that folder or that directory and I
want to
Maybe get to desktop or something like that now check
this out if I do CD desktop and
hit tab.
Notice that it doesn't go anywhere. It's not giving me that completion. But
when I do.
Again in hit tab it finishes. Why is that? Well,
keep in mind with Linux and and Callie and
any of the distributions really their case sensitive. So if
you type a lowercase letter, but the
directory or command or whatever the case may be starts with
a capital letter. It's not going to autocomplete or
execute accordingly. So keep in mind that that
everything here is going to be case sensitive and you'll want
to be mindful of that as you're working. So now we're in our desktop
directory and and that's great. So when I do my LS again,
Oh, wow, you'll notice that the stuff that we
have over here is now showing up in here minus the
computer icon that we have over here, but we've
got our read not txt
file here.
We've got this make dot txt. That's not showing up. So.
Now that we're here, let's say I want to be able
to see what's in that txt file without opening. I mean, yeah, you
can double click and it opens great. You can see it but if
we're working through and and we're not navigating via
the GUI and I want to read what's in that text file. I can
do what's called cat. It's short from concatenate and
I can do that read dot txt.
I just use tab there to auto complete and look it
shows the text that's in the file. So this is a quick way that you
can read that content of that
file and see what's in it. Now. Let's say that
I want to get rid of that weird makeup txt. Well, I
can use the move the remove command.
And then I can start typing the name of that.
And suddenly that that completes there's no error there. So
we do LS again.
And as you'll notice make dot txt is
no longer here so that RM allowed me to remove that
make not txt folder or
I'm sorry text file.
All right. So now
let's say that I want to go ahead
and
make another text file or something like that. So you
can also do cat which allowed
us to read.
And I can do a quick kind of
carrot here.
And it will output to a text or a
text file and so in this case, what I can do is I can
do test Dot txt.
And suddenly that creates a text file pretty quick on the desktop there.
So now I'm going to hit control C just to back
out.
And now I have an empty text file here.
So that's pretty neat stuff. That's a quick way to
create a text file quick way to read a text file quick way
to remove one. Let's say now that I want to make
a folder or a directory on the desktop.
So in this case, what I can do is mkder or
make directory and then I
can do let's just say I want to call it test directory.
Suddenly I've got folder over
here on the desktop named test.
so now when I look
You'll see that Test shows up here in blue now. We'll talk about
these colors and all those things in the next lesson. So
don't get hung up on the color just yet. We'll explain
all of that here soon.
Now let's say that I want to move my test dot txt to
the test folder that
I just created. So what I can do is I can
type MV for move.
That test Dot txt.
And then I'm going to move it to test.
Suddenly it disappears, right?
no longer there now if I do my
CD to test
LS for list suddenly, there. It
is. So pretty neat stuff. I mean
not not a lot to it. Once we get some of those basic commands
down and we're able to you know,
kind of cleanly navigate and make a few
files and do some things you're really ready to jump in and start working so good
job on that stuff. So you might be wondering why
you did a lot. How do I know what I've done this far? How
do I know what steps I've taken what if I want to see some things that I did earlier, but
I can't remember. Well, you can use
the history command.
And that cleanly lists out everything that we've done in this terminal.
Session here.
And then from there.
Let's say we're done.
And we can hit exit and it closes the terminal.
So with that in mind start doing some
navigation start working through the terminal on your own and practice
in some of those commands and before you know, it you'll be
an expert now. Let's do a quick check on
learning. You didn't think you were getting away without one of those did you so
what command allows you to move a file from One Directory to
another well with these in mind.
You may be thinking well MB move
makes sense, right? That would be correct. Keep
in mind that RM was to remove files
or content in kurum
make directory was to make a folder or a directory
LS was to list and move was to
move files from one directory to another. So in
summary you should have gotten a
very high level understanding on how to navigate through
Callie's directories how to create manipulate some
files in a high level and really how much fun you're
gonna have doing this stuff and working through the county distribution
or any distribution of Linux to to be honest and learning
these commands so great job. Thank you
for your time today and I look forward to seeing you again here
soon.