• Wincent
    Open
  • Blog
  • Wiki
  • Snippets
  • Tags
  • Search

Using Awk to show only old or even lines in a fileEdit

Created 7/20/2012, updated 5/18/2017

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
  • awk
  • wiki
Site
  • About
  • Blog
  • Wiki
  • Snippets
  • Tags
  • Search
External
  • GitHub
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
Colophon

Made by Greg Hurrell using React, Relay and GraphQL (with help from Git, Redis and Neovim).