Some uses of cat

Source: Internet
Author: User

Cat Name

Cat name1 name2 output name1,name2 files to the screen (first 1 after 2)


Cat >name Create name file: Content in standard input (CTRL + C or ctrl+d exit) (overwrites the original file)

Cat name >name2 Copy the name content to create name2

Cat >>name added after the name file: content in standard input (CTRL + C or ctrl+d exit)

Cat name1 name2 >>name3 connect name1,name2 content and add after Name3

The optional parameters are now:

-N or –number the number of rows for all outputs starting from 1
-B or –number-nonblank and-n similar, except for blank lines not numbered
-S or –squeeze-blank when you encounter a blank line that has more than two consecutive lines, replace the blank line with one line

-V or –show-nonprinting

eg. Cat-n name >name2 Copy the name content to create name2

Cat-b name1 name2 >>name3


Cat/dev/null >name to empty the name file


Cat <<eof >>name added after the name file: content in standard input (CTRL + C or Ctrl+d or EOF exit)

Some uses of cat

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.