Created
December 14, 2011 17:19
-
-
Save jbranchaud/1477523 to your computer and use it in GitHub Desktop.
Get a sorted list of unique items in a file with their number of occurrences.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Given a file, output a sorted list of unique items with the number of occurrences for each item next to it | |
fname=$1 | |
cat $fname | sort | uniq -c | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment