Awk: The Text Processing Beast
AS
Aman Saurav
12 min read
#text-processing
#linux
Awk is a domain-specific language designed for text processing and typically used as a data extraction and reporting tool.
Basic Syntax
awk 'pattern { action }' file
Print the first column of a file:
awk '{print $1}' data.txt
Column Delimiters
By default, Awk splits by whitespace. Use -F to specify a different delimiter, like a comma for CSVs: awk -F, ...