Created
October 27, 2011 14:08
-
-
Save alexmacedo/1319640 to your computer and use it in GitHub Desktop.
Shell command to remove .pyc files recursively.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# remove .pyc files recursively | |
find . | egrep *.pyc$ | xargs rm |
Find can do it all, quite simply. Try this:
find . -depth -name '*.pyc' -type f -delete
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
why not
find . -type f \( -name "*~" -delete -o -name "*pyc" -delete \)