↑ ↓ select, Enter open, Esc close

Print lines where a column value exceeds a threshold

Adjust the values, the command updates live
user@server
awk -v c=10 -v min=5000000 '$c + 0 > min + 0' /var/www/vhosts/system/example.com/logs/access_ssl_log

Prints only the lines whose value in the chosen column is greater than the threshold. The + 0 forces a numeric comparison, otherwise awk might compare strings. In the example it shows all requests in an access log with a response size above 5 MB.

Note: <, >= or == work instead of > as well. For text comparisons, drop the + 0 and put the value in quotes.

Also searched as

  • awk print lines where column greater than
  • show only lines with large values
  • awk condition on column

Related one-liners

All in Text processing

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.