Linux/dev/null detailed

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.