3.2 Linux Basics Part 2

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
5 hours 21 minutes
Difficulty
Beginner
CEU/CPE
6
Video Transcription
00:00
Hello and welcome to command line basics. In this video, we're gonna go over limits basics part two. I'm Christopher Tyler. Let's begin.
00:07
So we're lending objectives for this video. We're gonna lend a cat command line. 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 Lennox show.
00:25
All right, pre assessment. Which command allows you to scroll up and down in text? Is it a more be cat?
00:34
See less or D text?
00:38
The answer is C less. The less command will allow you to scroll down through to 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,
00:52
the more command will ally to scroll down the text and you could take your time reading it, but it will not. Ally, just grow back up If you need Thio, re read a previous line.
01:03
The cat command. It just spits out everything at once. and it won't like to scroll up and down unless you have a school bar in your command window. And the text command is not real command.
01:15
All right, so the cat command, like we just said, we can't. It can be used to spit out the contents of a fun.
01:21
And you can use it to combine more than one file at once as well,
01:25
and can't. Can't stands for concoct innate, which kind of means like to combine so you can combine as many pharmacists 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.
01:41
So this is a command you're gonna use pretty often.
01:44
I'll show you in my limits machine here, So I'm gonna type l s to see what folders I have available. So I have the files folder and I'm going to type C D space files
01:57
and it enter. And now the Do Ellis dash L. A. So I can see everything inside of this files folder.
02:05
And as you can see, I have a few text files here. So let's say I want to see what's inside the Hello, Dottie sti five
02:12
type Can't
02:15
hell and tab and I will auto complete this for me and I'm gonna have enter. And it says hello. This didn't overwrite. So this is from a later video, but, uh, this will show you exactly what's inside of this file with the cat command. Now, let's say I want to combine to arm or files together,
02:35
so I'm gonna push the up a rookie. So I get my previous command, and now I'm going to add
02:39
words, don t x t
02:43
and let's see, this was a bigger file and there we go. So it did have our first file from the helo dot t x t
02:51
and then immediately spit out the words that t x t directly after it.
02:55
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
03:07
the output. So this is where the morning the less commands come into play.
03:13
It's the more command. It allows us to read through the contents of, you know, file output, one screen at a time,
03:20
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 enter key or press the space key and go page down at a time.
03:30
The only limitation with more is that you cannot scroll back up.
03:35
So this is something we'll learn in the less command. But I'll take take a quick demonstration with this. So I'm gonna push ups. We have our previous command that we entered for Cat
03:46
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.
03:58
And we're going to take more
04:00
and enter. And as you could 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.
04:10
And if we could enter me a low down one line at a time
04:13
and if he hits space, go down a page at a time,
04:18
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 re read something earlier. This is kind of a play on words where less is more because it can do more things than less.
04:38
So it's that kind of funny, but easy to remember.
04:41
So let's do this same command that we just entered except instead of more type less.
04:47
And now I can use the down arrow key,
04:50
and I can use the up Orochi and go back up.
04:54
And just like more, we can push the Cuban
04:57
and immediately come back to our show. We need to,
05:01
and now we have the clear Screen command. This is very useful if you feel like there's too many things on 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.
05:13
And you may find yourself in this position pretty often because you'll, you know, enter some commands and you'll have a whole bunch of crazy output. You either weren't expecting or kind of overwhelmed with. So in order to kind of refresh the seal, I so you could focus on your task ahead,
05:30
type in the clear command and this will remove all of the text on the screen.
05:33
So
05:35
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 gonna type in clear
05:43
inner. Look at that nice, fresh new terminal.
05:46
And now what you can also do on ah Lennox, you could type the control l ke.
05:53
So let's say I got pack, um, wagon type control L. And it will clear my screen again. So just another useful little shortcut to kind of clear your screen.
06:05
All right, post assessment. How many files can can't combine that woods? Is it a only one
06:13
B to C three or D? No limit?
06:18
And the answer is D. There is no limit to the amount of files that can combine at once. This is very useful if you need to, you know, see the output of a whole bunch of different files at once. So and then, uh, later on, in the course, you'll learn about searching through output with grip,
06:35
and this could be another very easy way to search through many things at once with grab.
06:41
All right, So in this video we learned that cat 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.
Up Next