theshell.ch/site/pages/cmd/advanced/pipes.html
bevilj f6f42bfc01 advanced: fix header and pre tag usage
git-svn-id: svn+ssh://atelier.inf.usi.ch/home/bevilj/group-1@105 a672b425-5310-4d7a-af5c-997e18724b81
2018-11-11 16:47:25 +00:00

28 lines
895 B
HTML

---
layout: page
author: Domenico Votta
category-page: advanced
category-title: Advanced commands
tags: pipes redirect output input
title: pipes
---
<p>The <code>pipes</code> 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. </p>
<p> It is usually common to see the command grep and ps together, an example below.</p>
<pre>
ps aux | grep user
</pre>
<p>Lists all processes with your username</p>
<pre>
cat example1.txt | nl
1 Car
2 Computer
3 Robot
4 Smartphone
5 Videogame
</pre>
<p>In this example you send this output to another process, in this case, the <a href="{{ site.baseurl }}/pages/cmd/advanced/nl.html">nl</a> </p>
<p>You can use the commands that you learned and put them together, always respecting the logic of the command.</p>