Baltimore Squirrels

here squirrely, squirrely

A handy shell alias when working with python

Ever want to clean out all the compiled python files out of a directory tree? Maybe you don’t entirely trust the system you’re working on and you want to make sure the source files are being checked? Maybe you just don’t like looking at them? Either way, stick this in your ~/.bash_profile (or similar):

alias rmpyc="find . -name '*.pyc' -print | xargs rm -f"

(Please test with echo, and watch out for typos, rm -f can be a nasty bedfellow.)

Written by Tom

November 30th, 2007 at 11:29 am