.. include:: ../header.txt .. _pipe_shell: .. _pipe: The Pipe (`|`) =========================== .. index:: pipe, stdout, stdin, stderr, | A pipe is a facility of the shell that makes it very easy to chain together multiple commands. A pipe is called upon with the vertical bar character (**\ |**). When used between two Unix commands, it means that output from the first command should become the input to the second command. For example, to count how many files underneath a directory have been modified in the last day, the :command:`find` and :command:`wc` commands may be used along with a pipe (:ref:`find`, :ref:`wc`). The :command:`find` command will list the modified files and :command:`wc` can count them:: find . -type f -mtime -1 | wc -l To send out from stderr to the same pipe that stdout was sent to, put ``|&``, which is short for ``2>&1 |`` at the end of the command. :: find . -type f -mtime -1 | wc -l |&