Skip to content

Instantly share code, notes, and snippets.

@JohnArchieMckown
Last active August 29, 2015 14:21
Show Gist options
  • Save JohnArchieMckown/d4e051e3f48d60186370 to your computer and use it in GitHub Desktop.
Save JohnArchieMckown/d4e051e3f48d60186370 to your computer and use it in GitHub Desktop.
AWK code to remove duplicates lines. This does not require sorting then input, but may use a lot of memory. It simply uses an "associative array" in which the index is the data line. From an tweet by Tim Chase (@Gumnos)
#!/bin/awk
!a[$0]++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment