/Dev/null and/dev/zero files

Source: Internet
Author: User

1./dev/null
/Dev/null is equivalent to a black hole, and the data written into it will be lost forever. No data can be read from it.
In general,/dev/null is used to block shell error output.
./Myshell. Sh 2>/dev/null
The preceding command is used to execute a custom shell. If an error message is displayed during execution, the error message is redirected to/dev/null so that it is not displayed on the screen.
In addition, you can create a symbolic link to link a file (such as an advertisement file when surfing the Internet) to/dev/null. In this way, it will not be saved on the disk.
2./dev/zero
The content written to/dev/Zero will be lost. The data read from/dev/zero is a series of null values (Binary zero streams ).
This feature of/dev/Zero can be used to fill files.

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.