Skip to content

Instantly share code, notes, and snippets.

@nirinium
Created September 7, 2020 02:10
Show Gist options
  • Save nirinium/fdd9e335429052ffe818ad8b9eef0428 to your computer and use it in GitHub Desktop.
Save nirinium/fdd9e335429052ffe818ad8b9eef0428 to your computer and use it in GitHub Desktop.
Remove duplicates
awk '!(count[$0]++)' old.txt > new.txt
Sort wordlist by length
awk '{print length, $0}' old.txt | sort -n | cut -d " " -f2- > new.txt
Sort by alphabetical order
sort old.txt | uniq > new.txt
Merge multiple text files into one
cat file1.txt file2.txt > combined.txt
Remove all blank lines
egrep -v "^[[:space:]]*$" old.txt > new.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment