Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision |
ops102:redirection [2024/05/03 22:19] – [Standard File Descriptors] chris | ops102:redirection [2024/05/04 02:26] (current) – external edit 127.0.0.1 |
---|
-rw-r--r--. 1 chris chris 0 Sep 26 13:17 one | -rw-r--r--. 1 chris chris 0 Sep 26 13:17 one |
-rw-r--r--. 1 chris chris 0 Sep 26 13:17 two</code> | -rw-r--r--. 1 chris chris 0 Sep 26 13:17 two</code> |
| |
| Note that in this example, it is necessary to redirect stdout before redirecting stderr to the same location. |
| |
===== Piping ===== | ===== Piping ===== |
| |
Piping is a special case of redirection, where the output of one command is connected to the input of another command. This is set up using the vertical-bar (pipe) symbol: ''|'' (this may look like a solid or a dashed vertical line, depending on the terminal font in use). | Piping is a special case of redirection, where the output (stdout) of one command is connected to the input (stdin) of another command. This is set up using the vertical-bar (pipe) symbol: ''|'' (this may look like a solid or a dashed vertical line, depending on the terminal font in use). |
| |
For example, on Windows, the output of the ''help'' command is more than one screen long. You could pipe the output of the ''help'' command into the input of the ''more'' command to view one screen of text at a time: | For example, on Windows, the output of the ''help'' command is more than one screen long. You could pipe the output of the ''help'' command into the input of the ''more'' command to view one screen of text at a time: |