From the course: Linux: Shells and Processes

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Connecting programs with pipes

Connecting programs with pipes - Linux Tutorial

From the course: Linux: Shells and Processes

Connecting programs with pipes

- A pipe is a method of one program, communicating with another. A common use of a pipe is taking the standard output of one command and sending it to the standard input of another command. For instance, we could search through a file with grep and if the output was too long to fit on the screen, we could pipe the output to less a pager. Type into a terminal grep space, tcp, space, slash, etc, slash, services, space, pipe, space, less, and hit enter. This uses the grep command to search through the etsy services file for the word TCP and sends the resulting output to the less command, which displays it one page at a time. To quit press Q. You can pipe any number of times as it's not limited to just two commands. Bring your line back and erase less. Now add, awk, space, single quote, left curly brace, print, space, dollar sign, one, right curly brace, single quote, space, pipe, space, sort, space,…

Contents