Joined February 2012
·
Posted to
Remove all .pyc files from a directory
over 1 year
ago
Deleting with find
is common, so there's a shortcut:
find . -name "*.pyc" -delete
I will have to check out pyclean
. Thanks for the tip.
Achievements
184 Karma
6,096 Total ProTip Views
Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos
Mongoose
Have at least one original repo where Ruby is the dominant language
Python 3
Have at least three original repos where Python is the dominant language
Charity
Fork and commit to someone's open source project in need
Python
Would you expect anything less? Have at least one original repo where Python is the dominant language
Thanks for the great comments, all.
I've been thinking more about this. The UNIX philosophy is that a program should do only one thing and do it well. So upon further reflection, I think it's strange that the
find
command tries to do so much. It's great at finding stuff, but now I'm not so sure I should also be using it to delete stuff or execute other commands.Therefore, I think I'm going to go back to using the
find
andxargs
combo.