Linux basic configuration and management 2 ---- Linux multi-command collaboration-pipelines and redirection

Source: Internet
Author: User

Linux basic configuration and management 2 ---- Linux multi-command collaboration ---- pipelines and redirection Linux basic configuration and management 1 ---- Linux Network basic configuration http://www.bkjia.com/ OS /201309/240457.html 1 pipelines and redirection 1 in Linux most commands are very simple, there are few complex commands. Each command only implements a simple function, we can combine different commands to implement complex functions. 2. in Linux, almost all commands return plain text data, the vast majority of data in plain text format is input in command Form 3 multi-command collaboration is the flow of shell data in 4 command lines completed through pipelines and redirection. The following name is defined to describe the default stdin standard input 0 keyboard stdout standard output 1 terminal stderr standard error 2 Terminal 5 Command received parameters or data through stdin, stdout and stderr are used to output the result or error 2 redirection 1> and redirect the standard output to the file, if this file already exists, it will overwrite it. For example, we use echo "haha"> output to output the output, then echo "Linuxcast"> output overwrites 2> and redirects the standard output to the file, if this file exists, it will be appended to the back end. For example, echo "tmpLinuxcast"> output will be used to append the output to output 3 2>, redirects a standard error to a file. If there is already a standard error, it will overwrite it. For example, we use ls-ld www.google.com 2> output, then we will output the error to output 4. We can use 2> & 1 to redirect the standard output and standard error to a file 5. We can use <to redirect the standard input., however, a few 3 pipelines are used. | 1 grep command: grep keyword file 2 uses the standard output stdout as the standard input stdin of another command. For example, I output the details of all files in the home directory, then, we use the pipeline to extract the output information from the grep file containing the keyword.

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.