Created
February 2, 2011 15:55
-
-
Save mmaha/807896 to your computer and use it in GitHub Desktop.
Does a locate on specified filetypes;
This file contains 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
#!/usr/bin/env sh | |
# Might need to adjust awk $3 $4 according to OS | |
# Add $5 and so on to get more granularity | |
# This one is for Mac OSX | |
# *Test* it out with various files. YMMV. | |
locate "$1" | awk -F/ '{gsub($NF,""); print $3 "/" $4}' \ | |
| sort | uniq -c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment