Using Awk to show only old or even lines in a fileEdit
You can use this sort of trick, combined with grep
, to de-dupe repeated lines in a log file:
$ awk 'NR%2==0' file
$ awk 'NR%2==1' file
You can use this sort of trick, combined with grep
, to de-dupe repeated lines in a log file:
$ awk 'NR%2==0' file
$ awk 'NR%2==1' file