Video link
Potatoes:
Station B:
This chapter is about
The directory is as follows
1.Objective:
2.Basic formal notation:
2.1ingrepRetrieving charactersString (Grep-iv I is ignoring case, V is reverse selecting show no search string ' search string ' filename)
2.2Important special characters(characters) ([] ^ $ *)
3.Extended formal notation: (+? | () )
4.Format printing:printf ()
5. sed Introduction to Tools (SED ' 1a: ' A added d delete c replace)
6. awk Introduction to Tools (awk nf The total number of fields in each row NR is currently in line  FS current delimiter, default is space)
7. file data relative to print ()
7.1 file comparison: diff, CMP, Patch (diff old file New file cmp-s old File New file CMP default output first different point,-s output all patch to take advantage of. Patch diff file, also in the folder)
7.2 Span class= "Fontstyle2" > archive print ready: PR () span>
1.grep Search
1. [] The letters inside, no matter how many of them refer to a
2.grep Reverse selection ^ Note! ^ must be in [] inside is the reverse selection
3. Beginning ^ Line End $
4.*
Extended formal notation
Sed
The following examples show the results, and the contents of the file itself are not changed
So what if we want to change the contents of the document? It's just a plus-I.
// For example I want to modify vae.c this file, add vae below line 2nd, that is, the 3rd line is Vae ' 2a Vae ' vae.c // now I want to remove VAE, notice is to delete the 3rd line AH ~ ' 3d ' vae.c
Awk
Did you find a problem with line 2nd 32? Since 2 32 rows of data have spaces or tabs, be aware that your data has spaces or tabs when using awk to process data.
Also note that this is the line, $ $ is the first column, and the second column is ... Etc. v
Diff
is to compare the differences between the two files, often with the patch command
I changed a file
CMP compares two files, in bits
Patch let's explain a simple usage
First of all, write two different files into one document note! Diff must be added-naur
pr
Brother Bird's Linux private Cuisine--15th chapter: Formal notation