awk command examples
Remove duplicate lines using awk
$ awk '!($0 in
array) { array[$0]; print }' temp
Print all lines from /etc/passwd that
has the same uid and gid
$ awk -F ':'
'$3==$4' passwd.txt
Print only specific field from a
file.
$ awk '{print
$2,$5;}' employee.txt
More awk examples: 8 Powerful Awk Built-in Variables – FS, OFS, RS, ORS,
NR,NF, FILENAME, FNR
0 comments:
Post a Comment