AWK

AWK is a scripting language used for manipulating data and generating reports.

AWK supports variables, numeric functions, string functions, and logical operators.


About AWK

AWK Basics


Delete all blank lines from a file

Delete both leading and trailing whitespaces from each line

Delete consecutive duplicate lines

Delete leading whitespace and tabs from the beginning of each line

Delete trailing whitespace and tabs from the end of each line

Delete non-consecutive duplicate lines

Display line after the matching string

Display line before the matching string

Display lines that contain a specific string

Display lines that don't contain a specific string

Display number of lines that contains specific string

Display specific fields only

Find and replace a string

Find Number of open connections per IP

Number all lines in a file

Number only non-blank lines in files

Reverse order of fields in each line

Reverse order of lines