Linux black Hole

Source: Internet
Author: User

1 What is a Linux black hole

In the Linux system,/dev/null is a fake device, commonly known as "Linux black Hole".

Any write to/dev/null succeeds, but the data disappears without any feedback, and the read-in data is empty.

2 Linux black Hole What's around

The information that you don't want to display on the screen is often sent to/dev/null, which is used more in shell scripts. This command must be used in conjunction with output redirection.

Such as:

will see the output of all users of the system thrown into the black hole:

<span style= "FONT-SIZE:24PX;" >ls/home >/dev/null</span>

Empty the contents of the file, Without deleting the file:

<span style= "FONT-SIZE:24PX;" >cat/dev/null > Your_file_name</span> 
Note :

<span style= "FONT-SIZE:24PX;"  >cat/dev/null > Your_file_name</span> 
Command and

<span style= "FONT-SIZE:24PX;" >echo > Your_file_name</span> the 





(reference: empast http://www.linuxdiyf.com/viewarticle.php?id=273259)

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Linux black Hole

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.