Section outline

Main course page

  • Pipelining and input/output redirection are very useful, especially for writing automatics tests for homework assignments in courses such as Intro2CS.
    We're going to learn about these techniques here!

    Relevant links:
    Unit playlist

    ------------------

    • We will learn how to use pipelining to "stream" the output of one command to be the input of another command, and various command-line tools like 'uniq', 'sort', 'head', 'tail' and 'wc'.

    • Input redirection allows us to pass keyboard input to commands that usually take command-line arguments as inputs, and to to input arguments to commands that usually take keyboard input. We will learn how to redirect input using '<', '<<'.

    • Output redirection enables us to divert output intended for the screen to a file. We will learn how to redirect output using '>', '>>'.
      Note: if you have the "zsh" shell (this is the shell used by the university's computers), you may not have some of the error messages shown.
      If you really want to see these error messages, you can enable them by using the command "setopt noclobber".

    • A short quiz on the basics of pipelining and input/output redirection.

    • We will learn about 'standard' and 'error' outputs and how to redirect them using '>', '>>', '>&', '>>&', '/dev/null', '/dev/tty'.

    • Your dreams have finally come true, we can now construct super-powerful commands using all the techniques learnt so far - pipelining, and input/output redirection.

    • Let's see how deeply you've dived into the magnificent ocean that is pipelining and redirection. Hope you brought your snorkel!

    • Meme for finishing this unit Page

      Once you finish this unit, you'll be able to open this page and see a meme!

      Not available unless: The activity Basic pipelining and redirection quiz is complete and passed