Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python:': 0.05; 'bash': 0.09; 'deletion': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'subject:files': 0.09; "';'": 0.16; '-exec': 0.16; '-name': 0.16; 'hartley': 0.16; 'received:dip.t-dialin.net': 0.16; 'received:t-dialin.net': 0.16; 'wrote:': 0.18; "doesn't": 0.23; 'from:addr:web.de': 0.23; 'forgot': 0.28; 'exist.': 0.30; "didn't": 0.30; 'to:addr:python- list': 0.32; 'header:X-Complaints-To:1': 0.33; 'jonathan': 0.36; 'received:org': 0.37; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'more': 0.60; 'your': 0.61; 'suited': 0.67; 'limit': 0.67; 'exclude': 0.77 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Peter Otten <__peter__@web.de> Subject: Re: leftover pyc files Date: Thu, 03 Nov 2011 11:51:48 +0100 Organization: None References: <4EB14D9D.8080309@gmail.com> <11169846.60.1320306575820.JavaMail.geo-discussion-forums@yqiu15> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit X-Gmane-NNTP-Posting-Host: p5084a7a9.dip.t-dialin.net X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1320317523 news.xs4all.nl 6852 [2001:888:2000:d::a6]:52027 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15289 Jonathan Hartley wrote: > A task like this is more suited to bash than Python: > > find . -name '*.pyc' -exec rm '{}' ';' You forgot to exclude the .svn directory from the search and didn't limit the deletion to pyc-files whose corresponding py-file doesn't exist. How would your line look with these modifications?