Common Command Display
the difference between/dev/null and/dev/zero
1./dev/null: Represents a black hole, typically used to discard unwanted data output, or an empty file for the input stream
1.1 writes the useless output stream to the black hole drop.
Curl-iwww.baidu.com 2>/dev/null | HEAD-L error messages to a black hole
1.2 Emptying the file
Cat/dev/null >/home/omc/h.txt
1.3 In writing a timed task, the specification is to add >/dev/null 2>&1 to the end of all scheduled task scripts, so that all output streams (both incorrect and correct) are directed to the empty device drop.
* * * * */bin/sh/server/scripts/mysqlbak.sh >/dev/null 2>&1
2./dev/zero: When we use or read him, she will provide an infinite stream of empty data.
2.1 Overwrite other file information
2.2 Generates empty files of a specified size, such as swap files, simulating a virtual file system
Linux/dev/null detailed