Cmd Generator

awk

Pattern scanning and text processing language.

awk

Examples

# Print first column
awk '{print \$1}' /etc/passwd

# With custom field separator
awk -F, '{print \$1, \$3}' data.csv

# Print lines matching pattern
awk '/error/ {print NR, \$0}' log.txt

# Sum a column
awk '{sum += \$1} END {print sum}' numbers.txt

# With variables
awk -v threshold=10 '\$3 > threshold' data.txt