--- layout: page topic: The pipes command author: Domenico Votta category_title: Advanced Commands category_page: Advanced tags: pipes title: pipes ---

The pipes that in the shell are representend with the symbol | , they are used to join two commands on the terminal, taking the output of the first command and using it as input of the second.

It is usually common to see the command grep and ps together, an example below.

{% highlight ruby linenos %} ps aux | grep user {% endhighlight %}

Lists all processes with your username

{% highlight ruby linenos %} cat example1.txt | nl 1 Car 2 Computer 3 Robot 4 Smartphone 5 Videogame {% endhighlight %}

In this example you send this output to another process, in this case, the nl

You can use the commands that you learned and put them together, always respecting the logic of the command.