For details about the/dev/null and/dev/zero files, and solutions for accidental deletion of/dev/null and/dev/zero, and the disk I/O Testing Method Using/dev/zero, disk deletion and recovery by mistake1. Introduction-explanation from
The shell can often be seen: >/dev/null 2>&1The result of the command can be defined in the form of a%> output/dev/null represents an empty device fileWhere does the > delegate redirect to, for example: echo "123" >/home/123.txt1 means stdout
This article goes from http://www.kissyu.org/backgroundWe can often find such statements in a shell script >/dev/null 2>&1 . Before I did not go into the role of this command, copy replicable, until last week I wrote this order accidentally 2>&1
Transfer from http://blog.chinaunix.net/uid-25100840-id-3271224.html a few days ago interview has such a question, more strange: Explain the meaning of >/dev/null 2>&1: I was scratching, also did not think out, wrote a clear buffer, hehe online
Linux empty device file and redirection
Output/input redirection>>>&> 2 &> 2 <>>&> & 2
File descriptor (file descriptor), which is represented by a number (usually 0-9.Common file descriptors are as follows:Default file descriptor name0 standard
Linux is a file-based system, and all hardware, such as software, will have a corresponding file representation under the directory. For Dev This directory, we know the file below it, which represents the Linux device. In Windows systems, devices
Linux is a file system, and all hardware, such as software, will be represented under the appropriate directory. For the dev directory, we know that the file below it represents the Linux device. In Windows, devices are well understood, like hard
The shell can often be seen: >/dev/null 2>&1Eg:sudo kill-9 ' ps-elf |grep-v grep|grep $1|awk ' {print $4} ' 1>/dev/null 2>/dev/nullThe result of the command can be defined in the form of a%> output/dev/null represents an empty device fileWhere does
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.