Cat commands use Linux redirection to merge files

Source: Internet
Author: User

Cat commands use Linux redirection to merge files

Cat commands use Linux redirection to merge files

Take a look at the document:

[Doctor @ localhost Documents] $ <strong> cat -- help </strong>
Usage: cat [Option]... [file]...
Output A [file] or a combination of standard input to standard output.

-A, -- show-all equals-vET
-B, -- number-nonblank: number of non-empty output rows
-E equals to-vE
-E, -- show-ends: "$" is displayed at the end of each line"
-N, -- number indicates the number of all rows output.
-S, -- squeeze-blank does not output multiple empty rows
-T is equivalent to-vT.
-T, -- show-tabs: display the Skip character as ^ I
-U (ignored)
-V, -- show-nonprinting use ^ and M-reference, except LFD and TAB
-- Help: displays the help information and exits.
-- Version: displays the version information and exits.

If no file is specified or the file is "-", it is read from the standard input.

Example:
Cat f-g first outputs the content of f, then outputs the content of standard input, and finally outputs the content of g.
Cat copies the content of the standard input to the standard output.

Merge several files using commands

Cat a.txt B .txt> c.txt

Or

Cat a.txt B .txt> c.txt

The difference is that the first file is created or the file is truncated. The second is appended to the end of the file (the file does not exist ).

How to compile cat commands in Linux?

13 Cat command Management (display, sort, create) file instances

20 required commands for Linux beginners

This article permanently updates the link address:

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.