Cause
Recently used nohup created a background process, the default log output to the Nohup.out file, the program ran no longer tube, after about a week, found that the hard disk space is not enough, so find the reason, found that the Nohup.out file has been 70G, resulting in insufficient space on the hard disk.
Solution
Output only error messages to log files
Nohup./program >/dev/null 2>log &
I don't want any information.
Nohup./program >/dev/null 2>&1 &
Knowledge supplement, about Linux redirection
3 medium redirect for Linux
0: Indicates standard input
1: Standard output, in general use, the default is the standard output
2: standard error message output
Can be used to specify standard input or output that requires redirection. For example, the error message for a program is exported to the log file:./program 2>log. The standard output is still on the screen, but the error message is exported to the log file. In addition, redirects between 0,1,2 can also be implemented. 2>&1: redirect error information to standard output.
About/dev/null Files
Linux also has a special file/dev/null, it is like a bottomless pit, all redirected to its information will disappear without a trace. This is useful when we can redirect output to/dev/null when we do not need to echo all the information about the program.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/