5 hours 21 minutes
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.
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.
All right, pre assessment. Which command allows you to scroll up and down in text? Is it a more be cat?
See less or D text?
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,
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.
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.
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.
And you can use it to combine more than one file at once as well,
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.
So this is a command you're gonna use pretty often.
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
and it enter. And now the Do Ellis dash L. A. So I can see everything inside of this 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 Hello, Dottie sti five
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,
so I'm gonna push the up a rookie. So I get my previous command, and now I'm going to add
words, don t x t
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
and then immediately spit out the words that t x 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 morning the less commands come into play.
It's the more command. It allows us to read through the contents of, you know, 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 enter key 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 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
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 take more
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.
And if we could enter me a low down one line at a time
and if he hits 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 re read something earlier. This is kind of a play on words where less is more because it can do more things than less.
So it's that kind of funny, but easy to remember.
So let's do this same command that we just entered except instead of more type less.
And now I can use the down arrow key,
and I can use the up Orochi and go back up.
And just like more, we can push the Cuban
and immediately come back to our show. We need to,
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.
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,
type in the clear command and this will remove all of the text on the screen.
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
inner. Look at that nice, fresh new terminal.
And now what you can also do on ah Lennox, you could type the control l ke.
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.
All right, post assessment. How many files can can't combine that woods? 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 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,
and this could be another very easy way to search through many things at once with grab.
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.