Linux text editing

Source: Internet
Author: User

 

1. more $ less

 

More is similar to liss, for example.

 

Mkdir temp

 

Cd temp

 

Touch

 

Cat a | more/less

 

The long results of the first command are displayed by page.

 

 

 

2 cat & paste

 

Both cat and paste can display the content of the merged text file, but the difference between the two is that the content of the two text files is arranged in rows, paste is to sort the content of two text files in columns and a tab character is used between each column.

 

Assume that two text files 1 and 2 contain characters a and B respectively. Cat 1 2> 3 the content in 3 is:

 

B

 

Pasete 1 2> 3. The content in 3 is a B.

 

 

 

3 tail & head

 

These two commands are relatively simple

 

Tail-5 a displays the last five rows in file a. It can also display only five rows of head-5 a in file.

 

 

 

4 grep & find

 

These two commands are used to search for matched traveling line output in the file.

 

The Grep-I yuxianglong temp command is to find the complete path of the directory of the yuxianglong string in the temp file and print it to the screen. -I is a parameter, case insensitive.

 

Find Path Matching condition

 

For example, find/-name ls.txt and find the file named ls.txt in the root directory.

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.