Home > OS >  Linux grep command
Linux grep command

Time:09-24

4. If you need to use in the grep command extended regular expression, need E options, use the grep command to find week7. TXT file contains only digital lines, and sort by value from big to small,

5. Will week7. TXT file to The, You, One beginning sentences according to The line number big to small,

How to do the duck, the great god on

CodePudding user response:

Only use grep, the specific see your file content, letters and Numbers only, can the grep - Ev "[a-z]" week7. TXT | sort - nr, if there are some other characters, will reconsider

Grep -e "^ The | ^ One | ^ You" week7. TXT | tac

CodePudding user response:

Ok thank you thank you thank you thank you

CodePudding user response:

reference 1st floor zhouchao6 response:
grep, only the specific look at your file content, letters and Numbers only, can the grep - Ev "[a-z]" week7. TXT | sort - nr, if there are some other characters, will reconsider

Grep -e "^ The | ^ One | ^ You" week7. TXT | tac

If you have something like that to do, the fourth question

CodePudding user response:

reference 3 floor?????????? Blue response:
Quote: refer to 1st floor zhouchao6 response:
grep, only the specific look at your file content, letters and Numbers only, can the grep - Ev "[a-z]" week7. TXT | sort - nr, if there are some other characters, will reconsider

Grep -e "^ The | ^ One | ^ You" week7. TXT | tac

If you have something like that to do, the fourth topic

It depends on your line contains only Numbers, is only a series of Numbers (326438489), or a similar (25523, 43737, 4762772) that, if there is such, don't seem to be very good judgment, only use grep
Line contains only Numbers, no Spaces, grep -e "^ [0-9] + $" week7. TXT

CodePudding user response:

The
reference 4 floor zhouchao6 reply:
Quote: refer to the third floor?????????? Blue response:

Quote: refer to 1st floor zhouchao6 response:
grep, only the specific look at your file content, letters and Numbers only, can the grep - Ev "[a-z]" week7. TXT | sort - nr, if there are some other characters, will reconsider

Grep -e "^ The | ^ One | ^ You" week7. TXT | tac

If you have something like that to do, the fourth topic

It depends on your line contains only Numbers, is only a series of Numbers (326438489), or a similar (25523, 43737, 4762772) that, if there is such, don't seem to be very good judgment, only use grep
Line contains only Numbers, no Spaces, grep -e "^ [0-9] + $" week7. TXT

Using the sed command shows week8. TXT file contained in the line of argument word line number and the text, the line number in the top, and between words separated by a colon, does not distinguish between the first letter case, little brother, this how do ah

CodePudding user response:

Sed - n '/argument \ | argument/=;/argument \ | argument/p 'week8. TXT | sed - n' n. S/\ n/p: '

Sed - n '/argument \ | argument/=;/argument \ | argument/p 'week8. TXT
'//==is to print match the line number;
/argument \ | argument is matching argument or argument/
A semicolon. Followed by print matching content

For example, the previous output may be:
1
* * * * * * * * * argument
4
Argument * * * * *

Sed - n 'n. S/\ n/p: 'n lines is equivalent to the every 2 as 1 for processing, then the semicolon is followed by \ n replace:

CodePudding user response:

Afraid not sichuan alumni!!!!!!

CodePudding user response:

Ha ha ha ha ha ha still is really
  • Related