awk is a language for working with text files, a powerful text analysis tool, and awk is the initials of the three founders.
Syntax:
awk [option parameter] ' script ' Var=value file (s) or awk [option parameter]-F scriptfile var=value file (s)
Option parameter description:
-F FS or--field-separator FS
Specifies the input file delimiter, FS is a string or is a regular expression, such as-f
-V Var=value or--asign var=value
Assigning a user-defined variable
-MF nnn AND-MR nnn
Set intrinsic limits on the NNN value, the-MF option limits the maximum number of project blocks assigned to NNN, the-MR option limits the maximum number of records, and these two features are the extended functionality of the Bell Lab version of AWK, which is not applicable in standard awk.
-W compact or--compat,-w traditional or--traditional
Run awk in compatibility mode, so gawk behaves like standard awk, and all awk extensions are ignored.
Example:
$ Awk-va=1 ' {print $1,$1+a} ' Log.txt
2 3
3 4
This ' s 1
10 11
$ Awk-va=1-vb=s ' {print $1,$1+a,$1b} ' Log.txt
2 3 2s
3 4 3s
This ' s 1 this ' SS
10s
Operator:
Linux awk Command