From the course: Linux CentOS 7: Shells and Processes

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Named and unnamed pipes

Named and unnamed pipes - Linux Tutorial

From the course: Linux CentOS 7: Shells and Processes

Start my 1-month free trial

Named and unnamed pipes

- [Instructor] A pipe is a way of one program communicating with another. A common use for a pipe is taking the output of one command, and sending it to the input of another command. For instance, we could grep a file, 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 tcp /etc/services | less and hit enter. This looks through the etc services file for the word tcp and then sends the output to less, which presents it one page at a time. Press q to quit. You can pipe any number of times, as it's not limited to just two commands. For example, type in grep tcp /etc/services | awk '{print $1}' | sort | less This searches the etc services file for the word tcp, and then sends the lines to awk, which prints out the first column only, then sends the remaining output to sort, which sorts it, and finally sends it to less to view one page at a time. Hit enter. The type of pipes we are using are considered unnamed pipes. An…

Contents