December 2008
Intermediate to advanced
320 pages
6h 45m
English
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.
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 ...