Linux commands (vii) View files cat tac more less tail

Source: Internet
Author: User
Tags printable characters

If you want to view the files, use any of the cat less TAC tail and more.

1.cat

When you view a file using the Cat command, the contents of the entire file are displayed, and note that cat can only view the contents of a text file, such as viewing a binary file, the screen is garbled. In addition, cat can create files, merge files, and so on.

Command format: Cat [Options] [parameters]

Options:

-a equals the-vet combination, displays non-printable characters, and displays the $ symbol at the end of the line.

-B, similar to-N, does not number blank lines when viewing a file.

-E is equivalent to the-ve parameter combination.

-e Displays the $ symbol at the end of each line.

-N number each row when viewing the file.

-S when a row is encountered with more than two consecutive lines, the substitution is a blank line.

-T equals the-VT combination.

-T displays the TAB character as ^i.

--help display Help.

--version Displays version information.

--verbose shows the steps in detail.

Instance:

CAT/ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG-ENS33 View the network configuration file.

Cat-n Abc.tetx Displays line numbers, and blank lines are numbered.

  

Cat-b abc.tetx Display line numbers, blank lines are not numbered.

  

Cat 2.txt View the contents of the file and view the contents of 2.txt.

Cat 1.tetx 2.txt > 1_2.txt file content merging.

  

Cat > File1 Create the file and write the content, Ctrl + D ends.

The Ctrl + D position is wrong and should be on top.

Cat >>file1 Append content, Ctrl + D ends.

  

You can use cat to copy files, including text files, binary files, or ISO disc files.

Cat 1_2.txt > Back.bak copy 1_2.txt to Back.bak.

  

The cat command can display the contents of the file, which in turn is the TAC, and the TAC reads from the end of the file, showing the opposite of cat. Parameters are used the same way.

2. More and less

To be Continued ...

   

  

Linux commands (vii) View files cat tac more less tail

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.