using gnu find Oct 3, 2006 linux bash list all the directories excluding ".": find . -maxdepth 1 -type d -not -name ".*" find some string in all files matching a pattern in the subfolders (with grep -r you cannot specify the type of file) find . -name '*.py' -exec grep -i pdb '{}' \;