Linux basic configuration and Management 3 Linux command line Text processing tools

Source: Internet
Author: User
Tags command line

1 file browsing (Simple review)

1 Cat View the contents of the file

2 more in the form of Page view, but only to page down

3 Less is viewed as a page turn, but can support up and down pages

4 Head default is to view the first 10 lines, but we specify the number of rows to view

5 Tail The default is to view the following 10 lines, but we can specify the number of rows to view

2 keyword-based search

Let's say I created a tmp.cpp in my home directory.

1 command grep searches based on keywords

2 Single keyword search: grep keyword file name

Like I'm searching for Linux in Tmp.cpp.

More than 3 keyword search: grep-e keywords | keywords ... Filename

Like I'm searching in the Tmp.cpp. Contains Linux and test

4 Other parameters for grep

1-i is ignore case

2-n is the line where the result is displayed

3-v is the output of a line without a keyword (equals reverse)

4-ax is the output that contains the result of the row x row after

5-BX is the output of the time contains the result of the row x row before

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.