Shell [17] File merging and deduplication

Source: Internet
Author: User

There are three common file descriptors in shell programming:
0: stdin, standard input. The default value is the keyboard input.
1: stdout, standard output. The default value is screen output.
2: stderr, standard error output. The default value is screen output.

Simple redirection example
Command example
MD> file redirects stdout to file. CMD> file redirects stdout to file (append) CMD 1> Fiel redirects stdout to the file. CMD> file 2> & 1 redirects stdout and stderr together to the file. CMD 2> file redirects stderr to the file. cmd 2> file redirects stderr to the file (append) CMD> file 2> & 1 redirects stderr and stderr together to the file (append) CMD <File> file2 cmd command uses the file as stdin, use file2 file as stdoutcat <> file to open filecmd in read/write mode <file cmd command to use file as stdincmd <delimiter here document read from stdin until delimiter Delimiter is encountered
Related Article

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.