Pipe
From FreeBSDwiki
(Difference between revisions)
(Examples. Newbies need examples of actual use!) |
|||
Line 1: | Line 1: | ||
[[pipe]] -- represented by the '''|''' character (shift-\ on most keyboards) -- is a function of the shell, but works the same way in whatever shell you choose. It works, unsurprisingly, as a pipe between one command and another and is a form of [[redirection]], like '''>''', '''>>''' and '''<'''. Most often it's used to pipe lengthy output (e.g., '''[[ps]] aux''') to another command, like [[more]] (or [[less]]). | [[pipe]] -- represented by the '''|''' character (shift-\ on most keyboards) -- is a function of the shell, but works the same way in whatever shell you choose. It works, unsurprisingly, as a pipe between one command and another and is a form of [[redirection]], like '''>''', '''>>''' and '''<'''. Most often it's used to pipe lengthy output (e.g., '''[[ps]] aux''') to another command, like [[more]] (or [[less]]). | ||
+ | |||
+ | Example: | ||
+ | |||
+ | '''ls | grep log''' will list .log files as well as anything with the letters "log" in it instead of the whole current directory. | ||
+ | |||
[[Category:FreeBSD Terminology]] | [[Category:FreeBSD Terminology]] |
Revision as of 12:46, 17 January 2005
pipe -- represented by the | character (shift-\ on most keyboards) -- is a function of the shell, but works the same way in whatever shell you choose. It works, unsurprisingly, as a pipe between one command and another and is a form of redirection, like >, >> and <. Most often it's used to pipe lengthy output (e.g., ps aux) to another command, like more (or less).
Example:
ls | grep log will list .log files as well as anything with the letters "log" in it instead of the whole current directory.