Redirection and Pipes

Contents

Redirection and Pipes#

reading

We will loosely follow the Software Carpentry Pipes and Filters lesson from The Unix Shell

Let’s work through that lesson together…

Summary#

We learned the following commands:

  • wc : count the number of lines, words, and characters in a file

  • cat : print the contents of a file to the terminal

  • less : a pager that outputs the contents of a file one screen-full at a time

  • sort : sort the input data

  • head : output the first 10 (or specified number of) lines of a file

  • tail : output the last 10 (or specified number of) lines of a file

We also learned:

  • > redirect the output to a file

  • >> append the output to a file

  • | pass the output of one command to the input of the next