Skip to content

Instantly share code, notes, and snippets.

@mojtabacazi
Last active August 29, 2015 14:21
Show Gist options
  • Save mojtabacazi/49905ae9e05a24313630 to your computer and use it in GitHub Desktop.
Save mojtabacazi/49905ae9e05a24313630 to your computer and use it in GitHub Desktop.
Get all extensions and their respective file count in a directory
find ./ -type f | grep -E ".*\.[a-zA-Z0-9]*$" | sed -e 's/.*\(\.[a-zA-Z0-9]*\)$/\1/' | sort | uniq -c | sort -n
@mojtabacazi
Copy link
Author

Sample Result

   1 .a
   1 .c
   1 .caf
   1 .storyboard
   1 .xcbkptlist
   1 .xcsettings
   2 .json
   2 .lock
   2 .markdown
   2 .pbxproj
   2 .sh
   2 .xccheckout
   2 .xcuserstate
   2 .xcworkspacedata
   2 .xib
   6 .txt
   8 .md
  11 .pch
  12 .xcscheme
  13 .modulemap
  13 .ttf
  17 .plist
  22 .xcconfig
  36 .strings
  44 .png
 107 .m
 147 .h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment