Cover by Ron Peters

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

CHAPTER 9Data Redirection

Data redirection is when the input or output of a command is redirected using special notation. It is also used for opening and closing files for read and write operations. The forms and syntax of redirection are varied and their meanings are specific. I will cover some of the common uses here, and provide a bit more explanation than system man pages to aid you in avoiding pitfalls.

Avoiding Confusion

Data redirection is a common point of confusion among users. Problems with its usage arise most often when a user wants to set up a cron job that sends all its output to /dev/null, such as in the following crontab entry:

10 5 * * * /run/some/script > /dev/null 2>&1

In this example, all of the output will be sent to /dev/null ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required