Discussion> / dev / null 2> & 1

In crond scheduled tasks, nohup, we can often see> / dev / null 2> & 1, but many people do not understand what it is you want to really understand it, first of all we need to know three types of file descriptors.

Through the above table, we will> / dev / null 2> & 1 break it is easy to understand and more

> / Dev / null redirecting standard output to the null device, that is, we often say "black hole"

2> represents error output

Represents & meaning equivalent

1 standard output

2> & 1 on an error equivalent to the standard output redirection output

Therefore> / dev / null 2> & 1 and the output will represent the standard error output redirected to all "black hole", the results of doing so can effectively prevent output to the console, and the inode is filled.

Guess you like

Origin www.cnblogs.com/xzlive/p/11454306.html