Chapter 5. I/O redirection

Table of Contents

1. Simple redirections
1.1. What are standard input and standard output?
1.2. The redirection operators
2. Advanced redirection features
2.1. Use of file descriptors
2.2. Examples
3. Filters
3.1. More about grep
3.2. Filtering output
4. Summary
5. Exercises

Abstract

This chapter describes more about the powerful UNIX mechanism of redirecting input, output and errors. Topics include:

  • Standard input, output and errors

  • Redirection operators

  • How to use output of one command as input for another

  • How to put output of a command in a file for later referrence

  • How to append output of multiple commands to a file

  • Input redirection

  • Handling standard error messages

  • Combining redirection of input, output and error streams

  • Output filters