Skip to content

Instantly share code, notes, and snippets.

@wteuber
Last active August 29, 2015 14:05
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 wteuber/7ff3b84e8f854d617d77 to your computer and use it in GitHub Desktop.
Save wteuber/7ff3b84e8f854d617d77 to your computer and use it in GitHub Desktop.
list file extensions
# plain
find . -name '*.*' | sed 's/.*\.//' | sort -u | tr "\n" " "
# git
git ls-files "*.*" | sed 's/.*\.//' | sort -u | tr "\n" " "
# Explained
# find . -name '*.*' # List all files containing a '.'
# git ls-files "*.*" # List all tracked files containing a '.'
#
# sed 's/.*\.//' # Remove everything from string until the last '.'
#
# sort -u # Sort unique(!) output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment