Last active
May 27, 2019 23:23
-
-
Save treyharris/7a761db60e91323aa72868445fb6908c to your computer and use it in GitHub Desktop.
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/zsh | |
| # Count the filename extensions in the current or named subtree | |
| # Can be used as an autoloaded function or as a script. | |
| local rootdir usage | |
| rootdir="${PWD}" | |
| usage="usage: $0 [DIR]" | |
| if (( $#argv == 1 )) ; then | |
| rootdir="${argv[1]}" | |
| elif (( $#argv )) ; then | |
| echo "${usage}" 1>&2 | |
| return 1 | |
| fi | |
| print -l "${rootdir}"/**/*(.on:e) | | |
| uniq -c | | |
| sort -nr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment