O manual do GNU awk descreve a opção -f as:
-f source-file ou --file source-file
Read the awk program source from
source-fileinstead of in the first nonoption argument. This option may be given multiple times; the awk program consists of the concatenation of the contents of each specifiedsource-file.
Quanto aos operadores ~ e !~ , eles realizam comparações de expressões regulares:
-
exp ~ /regexp/- > é verdade, se a expressãoexp(tomada como uma string) corresponder à expressão regularregexp -
exp !~ /regexp/- > é verdade, se não corresponder a
Exemplo aleatório :
top -b -n 1|awk '$2 !~ /root/'|awk '$1 ~ /^[0-9]+$/'|head