|s i s t e m a o p e r a c i o n a l m a g n u x l i n u x||~/ · documentação · suporte · sobre|
This section explains in a very simple and practical way how to use pipes, nd why you may want it.
Pipes let you use (very simple, I insist) the output of a program as the input of another one
This is very simple way to use pipes.
Here, the following happens: first the command ls -l is executed, and it's output, instead of being printed, is sent (piped) to the sed program, which in turn, prints what it has to.
Probably, this is a more difficult way to do ls -l *.txt, but it is here for illustrating pipes, not for solving such listing dilema.
Here, the output of the program ls -l is sent to the grep program, which, in turn, will print lines which match the regex "\.txt$".
Next Previous Contents