Iamlaosong
I have a data import program, with Crontab set timed execution, sometimes the data need to re-import, on the human run once, the results found that the time for manual import is greater than the timing of the execution time, the reason, the initial estimate is to show the flowers, because the program in each import a data, Displays the name of the imported data and the record ordinal, to save time, you can redirect the output to/dev/null. Such as:
./impx.sh >/dev/null
You can think of/dev/null as a "black hole", which is very equivalent to a write-only file, and all the content written to it will be lost forever.
And try to read it from there. However,/dev/null is very useful for command lines and scripts.
1. Prohibit standard output
Cat $filename >/dev/null
# file content is missing, not output to standard output.
2. Prohibit standard error
RM $badname 2>/dev/null
# This error message [standard ERROR] has been thrown into the Pacific Ocean.
3, prohibit the output of standard output and standard error.
Cat $filename 2>/dev/null >/dev/null
4. Clear Log File contents
Cat/dev/null >/var/log/messages
#: >/var/log/messages has the same effect, but does not produce new processes. (because: Built-in)
The use of/dev/null under Linux