Hello and welcome to Command Line.
In this video, we're going to go
over Linux Basics Part two.
I'm Christopher Haler.
Let's begin.
So we're learning objectives for
this video. We're going to learn to
cat command the more command,
understand the less command and
clear the screen with the clear
command. And just like the previous
video. These are all very important
commands that you need to be
comfortable with in order to become
very effective at the Linux show
Tessman, which command allows
you to scroll up and down
in text?
Is it A more,
B cat, C
less or D text?
The answer is C less.
The less command will allow you to
scroll down through text
and scroll up in text.
This is very important.
If we have a huge output and we need
to be able to constantly reference
back and forth between the output,
the more command will allow you to
scroll down the text and
you can take your time reading it.
But it will not allow you to scroll
back up if you need to
reread a previous line,
the Cat Command, it just spits out
everything at once and it won't
allow you to scroll up and down
unless you have a scroll bar in your
command window.
And the text command is not a real
command
to the command.
Like we just said, the cat.
It can be used to spit
out the contents of a file
and you can use it to combine more
than one file at once as well.
And the cat stands for
CONCATENATE, which kind of means
like to combine so
you can combine as many files as
you'd like at once.
And it's very useful to just
see what's inside of a file
and see how it is
interpreted by the show.
So this is a command you're going to
use pretty often.
I'll show you in my
Linux machine here.
So I'm going to type to see what
folders I have available.
So I have the files folder and I'm
going to type code
space files
and enter and now I'm going
to do Ellis' dash away
so I can see everything inside of
those files folder.
And as you can see, I have a few
text files here.
So let's say I want to see what's
inside the hallowed autist file.
So I'm going to type Cat
and tab and
I will autocomplete this for
me and I'm going to hit enter
and it says hello, this
didn't overwrite.
So this is from a later video.
But this will show you exactly
what's inside of this file with the
cat command.
Now, let's say I want to combine two
or more files together,
so I'm going to push the up.
OK, so I get my previous command
and now I'm going to add
words to T
and let's see, this was
a bigger file and there we go.
So it did have our first file
from the loadout
and then immediately spit out the
words that t directly after
it.
So this was useful.
I could see exactly what was in
these files quickly.
But as you noticed, immediately
after I entered this command,
I couldn't see the beginning of the
the output.
So this is where the more the less
commands come into play.
So the more command it allows us
to read through the contents of
a file output one screen at a time.
And this allows us to read from
the very first line and take our
time. And we can go down either line
by line with the anarchy or press
the space key and go page down
at a time.
The only limitation with more
is that you cannot scroll back
up.
So this is something we'll learn in
the last command. But I'll take
take a quick demonstration with
this.
So I'm going to push up.
So we have our previous
command that we entered, Furkat,
and now we are going to pipe.
And what this does is the pipe.
It'll take the output of
the previous command and put
it as standard input into the next
command.
And we're going to type more
and enter.
And as you can see in the bottom
left hand corner, it says more
and it automatically starts at the
first line right here.
So we know we didn't miss anything
in our output.
And if we hit enter, we go down
one line at a time.
And if you hit space, go down
a page at a time.
All right, now we have the less
command and the less is very useful
because it has more functionality
as war, it's very similar,
but it allows us to scroll back up
if we need to reread something
earlier. And this is kind of a play
on words, we're less is more
because it can do more things
than less.
So it's kind of funny, but easy
to remember.
So let's do this same
command that we just entered, except
instead of more time less.
And now I can use the down arrow
and I can use the up and
go back up.
And just like more, we can push the
button and immediately
come back to our show when we need
to.
And now we have the clear screen
command. This is very useful if
you feel like there's too many
things in the screen at once and
you just want to kind of get rid of
it all so you could focus on what
you're trying to do.
And you may find yourself in this
position pretty often because
you'll enter some commands
and you'll have a whole bunch of
crazy output either weren't
expecting or kind of overwhelmed
with. So in order to kind of refresh
the Seelie so you can focus on
your task ahead, type in the clear
command, and this will remove all of
the text on the screen.
So let's say I
don't like all this stuff on my
screen. I just want to get rid of it
so I can focus on what I'm doing.
I'm going to type and clear and
look at that nice, fresh new
terminal.
And now what you can also do on
Linux, you can type the control
key.
So let's say I got PECC,
I can type control
and it will clear my screen again.
So just another useful little
shortcut to kind of clear your
screen.
All right. Post assessment, how
many files can combine at once.
Is it A only one
B to C
three or D no
limit.
And the answer is D there is no
limit to the amount of files I can
combine at once.
And this is very useful if you need
to see the output of a whole
bunch of different files at once.
So and then later
on in the course you'll learn about
searching through output
with grip.
And this could be another very easy
way to search through many things at
once with Ghurayb.
All right. So in this video we
learned that can command the more
command, understood the less
command. And we cleared the screen
with the clear command.
And I hope to see you in the next
video.