Linux sed and awk Cheat Sheet/Print rows matching a condition

Show lines where column 3 is greater than 100.

Section: awk Filtering and Aggregation

Print rows matching a condition

bash
bash
awk '$3 > 100 {print $0}' metrics.txt
Explanation

Awk's pattern-action style is ideal for tabular filtering.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing awk Filtering and Aggregation
Sum a numeric column
Add all values in the second field.
OpenIn sheetbashsame section
Calculate an average
Compute the average of a numeric field.
OpenIn sheetbashsame section
Count rows by key
Count occurrences of the first field.
OpenIn sheetbashsame section
Find the maximum value
Track the highest number in a field.
OpenIn sheetbashsame section
Match with regex in awk
Print only lines that match a regex.
OpenIn sheetbash2 tag match
Print selected columns
Show the first and third whitespace-delimited fields.
OpenIn sheetbash1 tag match