Skip to content

Instantly share code, notes, and snippets.

@dilijev
Last active March 2, 2016 01:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dilijev/5b176d07cda472bb1ab8 to your computer and use it in GitHub Desktop.
Save dilijev/5b176d07cda472bb1ab8 to your computer and use it in GitHub Desktop.
Bash one-liner to find all filetypes in a git repo
git ls-files | grep -P '\/[^\/\.]*\.[^\/\.]+$' | sed -r 's/.*\.([^\/\.]+)$/\1/g' | sort | uniq
#!/usr/bin/sh
# add this file on the path so that you can run the following command:
# git filetypes
git ls-files | grep -P '\/[^\/\.]*\.[^\/\.]+$' | sed -r 's/.*\.([^\/\.]+)$/\1/g' | sort | uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment