shell /dev/null

/ Dev / null null device indicates, this is the log to the null device, the log is not recorded, a special index value is Null (An article or reference reference) indicates that this index does not point to any object.

Is a special file, its contents will be written to be dropped, if you try to read from the file, then nothing can not read, but the / dev / null file is useful, the command output redirected to it, It will play the effect of "No output".

Extended Information:

Use: ban the standard output

CAT $ filename 1> / dev / null # contents of the file is lost, but not to the standard output, standard error prohibited.

2, dev / null error message such [standard error] was not known where the lost.

3,1> / dev / null Meaning 2> & 1> where to redirect representative of, for example: echo "123"> /home/123.txt 1 represents stdout standard output, the system default value is 1, the "> / dev / null "is equivalent to" 1> / dev / null "2 represents a standard error & represented stderr equivalent meaning.

4,2> & 1, 2 represents the output redirection is then equivalent to a statement herein title 1> / dev / null first standard output redirection device to an empty file, i.e. does not output any information to the terminal, that white is not display any information. 

5,2> 1 & Then, the standard output redirection is equivalent to the standard error output, the standard output because before the empty device has been redirected to the file, it can redirect the standard error output device to an empty file.

Guess you like

Origin www.cnblogs.com/jianzhaojing/p/11447661.html