Job One: organize regular expression Blogs
Job Two: grep jobs (regular expressions and character processing)
Target file/etc/passwd, using the grep command or Egrep
1. All rows containing root are displayed:
2. Output any rows that contain bash, and also output the contents of the next two lines, followed by the row:
3. Shows how many lines contain nologin.
4. Shows that the rows contain root and the line number is output.
5. Displays the file in the
6. New user
Abominable
Abominate
Anomie
Atomize
Write regular expressions and match them up
7. Built four users
Alex213sb
wpq2222b
Yh438pig
egon666
Egon
Filter out the user name consists of a letter + number + letter Line
8. Displays all filenames containing root in/etc directory
9. Filter out all comments and all blank lines in/etc/ssh/sshd_config
Job Three: SED job:/etc/passwd file as Template
1. Delete the first character of each line of the file.
2. Delete the second character of each line of the file.
3. Delete the last character of each line of the file.
4. Delete the second-to-last character of each line of the file.
5. Delete the second word in each line of the file.
6. Delete the second-to-last word in each line of a file.
7. Delete the last word in each line of the file.
8, swaps the first character and the second character of each line.
9, swaps the first character and the second word of each line.
10, swap the first word and the last word of each line.
11, delete all the numbers in a file.
12, remove all spaces at the beginning of each line.
13, replace any spaces that appear in the file with tabs.
14, enclose all uppercase letters in parentheses ().
Sed-r ' s/[a-z]/(&)/g '/etc/passwd
15, print 3 times per line.
16, only the first word of each line is displayed.
17, print the first word and the third word of each line.
18, use the command to get the format MM/YY/DD date format, combined with the pipeline, change it to MM;YY;DD format
Shell: Regular expressions and text processing