Find Recipes for the find command Exclude directories find . -type d ( -path ./directory1 -o -path ./directory2 ) -prune -o -iname "*.txt" -print -exec mv {} TXT ; Delete all files in a git directory find . -maxdepth 1 ! -name ".git" -exec rm -rf {} ;