Creating Pipelines of Data
Explore how to create pipelines by connecting multiple Unix command-line programs using pipes. Understand how to redirect output as input between tools like ls, less, head, tail, awk, and sort to manipulate text data effectively and solve complex processing tasks.
We'll cover the following...
Pipeline of programs
One of the main foundations of a Unix-based system is that programs work together as a pipeline. The output of one program can be the input of another. In other words, we send the standard output of one program to the standard input of another.
The less command makes it easy to navigate through a large file by reading it one page at a time, but less also accepts input from standard input. If we have a very long directory listing, we can send the output from the ls -alh command to the less command to paginate the results:
$ ls -alh /usr/bin | less
Use the terminal below to practice these commands.