Using awk to filter lines on column values

posted on 10:28 AM on Thursday 15 August 2013

You can use the following awk snippet to filter the lines of a text file by a certain condition:

cat some_file | awk '{ if($1>1) print $0 }'

The above snippet prints out the line in the text file is the first column has a numeric value greater than one.

See for more details.