nawk unix tool

Awk Utility Awk scans a file (or input) line by line, from the last line, searching for lines that match a specified pattern and performing selected actions ( enclosed in curly braces) on those lines.
%nawk 'pattern' filename
%nawk '{action}' filename
%nawk 'pattern {action}' filename

-- if the regular expression z is matched anywhere on the line, awk prints the entire line.
nawk -F: '/z/' file.txt

-- if the line begins with one or more upper or lowercase letter a's, the entire line is printed.
nawk '/^[Aa]+/' file.txt

-- if the line begins with apple followed by zero or more of any character, the entire record is printed. The special variable $0 contains the entire record that was entered in the database
nawk '/^apple.*/{print $0}' file.txt