Skip to content

Instantly share code, notes, and snippets.

@dnorton
Created January 8, 2015 22:22
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 dnorton/2417e077de2bb8365ebd to your computer and use it in GitHub Desktop.
Save dnorton/2417e077de2bb8365ebd to your computer and use it in GitHub Desktop.
find *.sh files
>>> import os
>>> import fnmatch
>>>
>>> for root, dirnames, filenames in os.walk('dir1'):
... for filename in fnmatch.filter(filenames, '*.sh'):
... print os.path.join(root, filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment