Linux Learning note 033_8 Text processing

Source: Internet
Author: User

Less

One display can be up (n), page Down (n), and you can find:/keyword,v into the editor

Cat

Display text content at once

More

Carriage return down one line, space down a page, but cannot page up

nl

Show output of line numbers

Head

Show the first 10 lines of a file

Head-n A:

Show first 15 lines of file a

Tail

Show the last 10 lines of a file

Tail-n A:

Show the following 15 lines of file a

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/2E/wKiom1PuCV6AgXZzAAAibZZBU3s431.jpg "title=" Clipboard1.png "alt=" Wkiom1pucv6agxzzaaaibzzbu3s431.jpg "/>: View the last 10 lines of the log

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/46/2E/wKiom1PuCYaAKvxtAAAhqVq8r1U069.jpg "title=" Clipboard2.png "alt=" Wkiom1pucyaakvxtaaahqvq8r1u069.jpg "/>: real-time display of the last 10 rows, if no-f is static

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/46/30/wKioL1PuCqzCzqrIAAAg10rFJCM641.jpg "title=" 3.jpg " alt= "Wkiol1pucqzczqriaaag10rfjcm641.jpg"/>: Extract 11 to 20 rows saved in file

grep: (Regular expression)

Filter keywords in behavioral units

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/46/30/wKioL1PuCt2xPHg4AAAtYEgbCZE075.jpg "title=" Clipboard4.png "alt=" Wkiol1puct2xphg4aaatyegbcze075.jpg "/>: Find keywords in file passwd redhat and print this line of keywords with color on the keyword

Date--help |grep--color=auto Year: Find the Year keyword in Help for date

-I: Ignore case

-N: Filter out which line in the file

-V: Direction selection

-A x: Displays the following X-lines of rows that match the filter

-B x: Displays the first x rows of the row that matched the filter (contact context)

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/46/30/wKioL1PuCxPBgWI3AAAlgOb2u_Q521.jpg "title=" Clipboarda.png "alt=" Wkiol1pucxpbgwi3aaalgob2u_q521.jpg "/>: Find out which path Ip_forward is under

-r: Recursive query directory

Cut

Filter by column as unit

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/2E/wKiom1PuCt7TEmVtAAAnIViTOmw494.jpg "title=" Clipboard5.png "alt=" Wkiom1puct7temvtaaanivitomw494.jpg "/>: Filter out the first column for delimiters, this command shows all users, if-f1-3 is first to third column, if is-d ' is separated by an irregular number of spaces in the middle,-c2-5: the 2nd to 5th character

Top

Show process

235/60 R17 Maxxis

WC: (Word count)

Word count: WC a.txt

-L: Show only the number of rows

-W: Displays only the number of words

-C: Show only the number of bytes

-M: Shows the number of bytes (not shown by default)

Sort

Sort (default ascending)

-R: Descending sort

-t:650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/46/2E/wKiom1PuCw6jR7QuAAAhtP52iuM326.jpg "title=" Clipboard6.png "alt=" Wkiom1pucw6jr7quaaahtp52ium326.jpg "/>: Sort by a colon-separated third column

-N: Sort by number, sort by character by default

-F: Ignore case difference sort, default lowercase in front of uppercase

-U: If two rows are sorted and parallel then the duplicate is removed (unique), equivalent to | Uniq-c

Diff:

Compare the differences between two articles

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/46/30/wKioL1PuDDuDTly-AABYtbZA6Fg159.jpg "title=" Clipboard7.png "alt=" Wkiol1puddudtly-aabytbza6fg159.jpg "/>

Patch

Patching: Essentially compare the old and new two files, generate a patch file, hit on the file

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/46/30/wKioL1PuDNeBixPSAACx-E6ycxk960.jpg "title=" Clipboard8.png "alt=" Wkiol1pudnebixpsaacx-e6ycxk960.jpg "/>

-U is to output new and old files without adding some syntax, generate patch files, no-U is normal file

-B Backup long files for patching

Aspell

Grammar check

Aspell List < A.txt |wc-l

Tr:

Case conversion: TR ' A-Z ' A-Z ' <a.txt: uppercase converted to lowercase

Sed:

Find and replace

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/30/wKioL1PuDOeTQ5pgAAAUV2tBuNg039.jpg "title=" Clipboard9.png "alt=" wkiol1pudoetq5pgaaauv2tbung039.jpg "/>:s for Find, G for all, find dog and replace all to cat, if no G replaces only the first keyword, pers is the file name

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/46/30/wKioL1PuDTegrDy_AAAXNV8rV6g898.jpg "title=" Clipboard10.png "alt=" Wkiol1pudtegrdy_aaaxnv8rv6g898.jpg "/>: Replace only 1~50 rows

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/46/2E/wKiom1PuDLvQNCfYAAAlPhe_vkg020.jpg "title=" Clipboard11.png "alt=" Wkiom1pudlvqncfyaaalphe_vkg020.jpg "/>: Replace with dibgy beginning with the middle dog in Duncan end to Cat

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/46/30/wKioL1PuDd7z8U98AAAdyBDFns0876.jpg "title=" Clipboard12.png "alt=" Wkiol1pudd7z8u98aaadybdfns0876.jpg "/>: Simultaneous two find replacements

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/46/2E/wKiom1PuDM-yHDAoAAAStrSykkM004.jpg "title=" Clipboard13.png "alt=" Wkiom1pudm-yhdaoaaastrsykkm004.jpg "/>: Writes the find and replace operation in the Myedits file, myedits content: s/dot/cat/g


This article is from the "FLYCLC" blog, make sure to keep this source http://flyclc.blog.51cto.com/1385758/1540841

Related Article

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.