Tutorials

AWK Patterns


The -F option with the colon(:) indicates our field separator is the colon. The regular expression indicates to match ksh at the end of each password record.
awk -F: ‘ /ksh$/ { print $1 } ‘ /etc/passwd
compound pattern {statement(s)}
awk -F”|” ‘ $6 == “CA” && $5 ~ /San Jose/ ‘ phone.lst 
AWK Tutorial
awk Variables
awk Arrays
awk Patterns
awk Select
awk Control Statements
awk examples