linux[Basic]-07-text file operation [01]

Source: Internet
Author: User

Text File Editor commands

    1. Cat: Used to view plain text files (shorter)

Format: Cat [Options] [file]

Parameters

Role

-N

Show line Numbers

-B

Show line numbers (blank lines are not shown)

-A

Displays the not visible " a symbol, such as a Space tab

    1. MORE: For viewing plain text files (longer)

Format: more [options] [file]

Parameters

Role

- Digital

How many rows are displayed in advance

-D

Show message and error content

    1. Head: Used to view the first n rows of a plain text file

Format: Head [options] [file]

Parameters

Role

-N

View Top N Line

-n-10

View all but do not show after Line

    1. Tail: Used to view the following n lines of a plain text file

Format: tail [options] [file]

Parameters

Role

-N

show the post N of a file Line

-F

Refresh the displayed content continuously

Usage: Tail–n 3 last.txt is to view the following 3 lines of the Last.txt file

    1. Od: For viewing files in special formats

Format: OD [options] [file]

Parameters

Role

-ta

Show default formatting

-tc

Show ASCII Coding

-to

Show octal

-td

Show decimal

-tx

Display hexadecimal

-tf

Show floating-point numbers

    1. Tr: Used to convert characters in a text file

Format: TR [source character] [target character]

[Email protected] lab1]# more Tr.txt

A b c d e F g h i j k l m n o p q R S t u v w x y Z

[Email protected] lab1]# more Tr.txt |tr [A-z] [a-z]

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

    1. Wc: The number of lines, characters, and bytes used to count text files

Format: WC [parametric] File

Parameters

Role

-L

Number of rows displayed

-W

Displays the number of characters

-C

Number of bytes displayed

linux[Basic]-07-text file operation [01]

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.