Linux Command-cat command

Source: Internet
Author: User

The function of the Cat command is to connect files or standard input and print, and today we will introduce you to the cat commands in Linux.

For more information on Linux commands, see: Linux Command Quick check manual

Linux's cat commands are typically used to display file content or to connect several files to display, or to read from standard input and display, often in conjunction with redirection symbols.

First, the Linux Cat command syntax format
Cat [OPTION] ... [FILE]:

Parameter description:

-A,--show-all           equivalent to-vet-b,--number-nonblank    to non-null output line number-e                       equivalent to-VE-E,--show-ends          show $-n at the end of each line,--number     for all line numbers of the output, the number of rows starting at 1 for all outputs is number-S,--squeeze-blank  has two consecutive lines above the blank line, the substitution is a line of blank lines-t                       and-VT equivalent-T,--show-tabs          Display the tab character as ^i-u                       (ignored)-V,--show-nonprinting   with ^ and M-references, except LFD and TAB
Ii. examples of use of Linux cat commands

1) Display the contents of the file

#cat File1this is a test file. Welcome to Linuxdaxue.com!this is Cat command test.

2) Enter the File1 content and line number into the File2

#cat-n file1 > File2[[email protected]/root/linuxdaxue.com/testdir] #cat file2 1 This is    a test file.     2    Welcome to linuxdaxue.com!     3 This is    Cat command test.

3) Empty file2 content

#cat/dev/null > File2#cat file2#

4) Linux TAC command

The TAC is cat in turn, and the function is the opposite of cat, which is used to output files from back to forward.

Here are the differences between the two commands

[Email Protected]/root/linuxdaxue.com/testdir] #cat file1this is a test file. Welcome to Linuxdaxue.com!this is Cat command test. [Email Protected]/root/linuxdaxue.com/testdir] #tac file1this is cat command test. Welcome to Linuxdaxue.com!this is a test file.

Well, the contents of the Linux Cat command are described here, for more information on Linux commands see: Linux command Quick check manual

    • Copyright Notice: original article, 3 months ago, published by the University of Linux (linuxdaxue.com), a total of 1015 words.
    • reprint Please specify: Linux Command-cat Command | Linux University

Linux Command-cat command

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.