linux/awk

AWK Text Processor

Pattern scanning and processing language

text
processing
scripting

Command

awk

Explanation

awk is a powerful text processing tool for extracting and manipulating data from files.

Examples

Print first column

awk '{print $1}' file.txt

Print usernames from passwd file

awk -F: '{print $1}' /etc/passwd

Print lines where 3rd field > 100

awk '$3 > 100' data.txt