Pipes, a pipe is used by the shell to connect the output one command directly to the input of another
command.
The symbol for a pipe is a vertical bar.
The command syntax is.
Command or the option or the argument and then you pipe it to another command, whether it's option
or an argument, if there is any.
Basically, if you wanted to connect to commence together or if you wanted to take the output off the
first command and pipe it to a different output, then you could use a pipe in a Mac keyboard.
A pipe is somewhere the key all the way to the right that looks like that.
And in a regular keyboard, you will see the pipe option is right below the backspace.
And you could do, I think, with the shift and pipe.
So the way it works is you have a you have a command, it goes into a pipe and it comes out the output.
So let's say if you have an S minus L, that's a command you run, you pipe that the exact same pipe
character that you use and you put another command to it to refine the output of your last command.
So let's look at the example in our Linux machine.
If we are in slash at sea directory, by the way, where we are, we are in our home territory.
So if if we go into CD slash Etsy now, this directory has a bunch of files and directories which you
cannot view all in one page.
It will display all at once, but everything will scroll up so fast as you wouldn't even able to view
one by one.
So when you do LS minus L TR, you hit enter.
You see it went up so fast, which you could do, you could scroll up.
So of course, when you do.
Scroll down, slow, very slow.
You're going to see all those files, commands and directories that are inside of Etsy.
Now you wired to view all of them.
One page at a time.
So how do you do that?
The way you do it, you put it in a pipe.
So you first you do LS minus l tr.
You pipe it.
And then there is a new command that I want you to learn, which is called more.
More is the command which gives you the output of a file.
One page at a time.
So when you do this myself, TR pipe it and more, it hit.
Enter.
Go.
Now you will see one page at a time.
Of all the contents of ETSI directory.
And at the bottom, it does tell you that it's more you hit spacebar to go down to the second page.
Spacebar again, spacebar again, wherever you are, you could quit out of it by hitting cue and you'll
get your palm back again, let's do up arrow key.
Hit enter spacebar, spacebar, spacebar, spacebar to go all the way down.
You keep hitting the spacebar, and that's your problem back.
So that's how you put in a pipe.
You could also do a pipe to have the output of a command and change its output to a different way.
Let's say, if you want to do this, by the way, there's another command, which is a simpler command
if you want it to learn is L-l, which also give you the result as if you are doing a less muscle.
So you do L-l and you learn to command more.
That should give you one page at a time.
What if you want to get the last line of your output?
Then you run this muscle, pipe it, and to get the last line, you will have to do tail minus one,
and it gives you the last line of your output.
No tail is another command, which is also a cool command, which will give you the last line or lines
of an output which will cover later on.
So this is what the pipe is.
I want you to try with different commands.
Learn about pipe.
I'm not sure if there is a man page for pipe because it's a character, but let's see.
Yeah, there is none.
But if you wanted to know more about pipe, I have some documentation you could get it or you could,
of course, look it up online to find out more about pipes.
The pipe is very important for our lessons that we will be covering later on because this is how we
going to combine our commands.