Skip to content

Instantly share code, notes, and snippets.

@randria
Created December 28, 2019 12:00
Show Gist options
  • Save randria/d04adc22a04c2295635853694f9332b0 to your computer and use it in GitHub Desktop.
Save randria/d04adc22a04c2295635853694f9332b0 to your computer and use it in GitHub Desktop.
list duplicates and remove them
shasum -a 256 * > initial.txt
sort initial.txt | awk 'BEGIN{lasthash = ""} $1 == lasthash {print $0} {lasthash = $1}' > duplicates.txt
comm -23 initial.txt duplicates.txt > cleaned.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment