Table of Contents

AWK - About AWK

AWK is a programming-language tool used to manipulate text.

It allows you to create short programs that read input files, sort data, process it, perform arithmetic on the input, and generate reports, among myriad other functions.

The language of the AWK utility resembles the shell-programming language in many areas, although AWK’s syntax is very much its own.

When first created, AWK was designed to work in the text-processing arena, and the language is based on executing a series of instructions whenever a pattern is matched in the input data.


AWK Syntax

The general syntax for the command is:

awk '{pattern + action}' {filenames}

NOTE: Curly brackets ({}) are not always required around your program, but they are used to group a series of instructions based on a specific pattern.


AWK Workflow

AWK follows a simple workflow − Read, Execute, and Repeat.