Skip to content

Instantly share code, notes, and snippets.

@alexmacedo
Created October 27, 2011 14:08
Show Gist options
  • Save alexmacedo/1319640 to your computer and use it in GitHub Desktop.
Save alexmacedo/1319640 to your computer and use it in GitHub Desktop.
Shell command to remove .pyc files recursively.
#! /bin/sh
# remove .pyc files recursively
find . | egrep *.pyc$ | xargs rm
@sanfx
Copy link

sanfx commented May 25, 2015

why not
find . -type f \( -name "*~" -delete -o -name "*pyc" -delete \)

@CaptGreg
Copy link

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