Hey everybody welcome to the next video in the next operating system module.
So in this video we're talking about Linux pipes are Linux named pipes.
Now they're very similar in how they work to Windows.
The difference being is we can manipulate them a little bit easier and work with them on a simpler basis
than trying to handle the Windows API.
Now what Linux uses is something called M.K. First In First Out.
That is the command to create a named byte so we got named Piper right.
And we do a last dash L and we'll do that again.
Spell it right this time
so as we can see named pipe is yellow now it's yellow because it doesn't have that pipe symbol.
This one at the end in most cases if it was just a standard prompt on any special formatting you would
just you would see that at the end we can also see that it says P right here at the beginning.
Now that stands for pipe that's how you can identify them relatively easily.
Now let's say I want to send data to a pipe so if I do I go red team nation rocks.
Right we send that into the named pipe.
You'll notice something.
It sits now way names pipe works just like they do in Windows when something is sent the sending process
halts until the other end of the pipe connects and gets the data.
So if you are writing something that using naming pipes this also handles for standard input an output
when you're doing when you're using stuff like Python and some process where you're trying to talk to
a process by sending it input and getting output.
Be very aware that it needs a connection from the other side some sort of response to make this work.
In most cases now there's a few ways around it.
But in this particular case with named pipes there's not.
So what we can do is we can go over this other one and we can cat out named pipe.
So what this will do is this will grab the input from named pipe and go ahead and release the promise.
Now we get our Red Team rocks and a pipe is good right.
So if we cat or cutting named pipe nothing.
So it's just gonna hang there so again if we do Red Team nation rocks we just sit there and maybe we
want to sort this one right pipe that into sort.
Now there's only one line.
There's nothing to sort but you see the picture and how it kind of how it kind of works.
It's important to understand that that deadlock can happen and it will wait for the other side.
So this has been kind of how named pipes work behind the scenes.
You can find them similar to how you do the same things with the type command inside of find.
Go ahead and play around with this and see we come up with.