public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Daniel D Jones <ddjones@riddlemaster.org>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] xargs and rm funkiness
Date: Sun, 23 May 2010 13:51:10 -0400	[thread overview]
Message-ID: <201005231351.10622.ddjones@riddlemaster.org> (raw)
In-Reply-To: <20100522132555.028cba37@zaphod.digimed.co.uk>

On Saturday 22 May 2010 08:25:55 Neil Bothwick wrote:
> On Sat, 22 May 2010 12:35:10 +0100, David W Noon wrote:
> > >find -name *.ext -exe rm "{}" +
> >
> > Or simpler still:
> >
> > find -name *.ext -delete
> 
> Neat - I hadn't noticed that option.
> 
> Anyone for find / -delete ?

If you use the -delete switch, just be careful.  From the man page:

<QUOTE>
Warnings: Don't forget that the find command line is evaluated as an 
expression, so putting -delete first will make find try to delete               
everything  below  the starting points you specified.  
</QUOTE>

That means that the command

find -name *.tmp -delete

will delete all your temp files while

find -delete -name *.tmp

will delete everything below your current directory.  If you're in the root 
directory, it's equivalent to running your suggested command above.  I just 
found this out the hard way, although luckily I wasn't in the root directory 
when I ran the command and so didn't trash my system.  I did lose the changes 
I'd made to the project I was working on but fortunately had a backup of the 
original files.
 
-- 
"If you give me six lines written by the most honest man, I will find something 
in them to hang him." - Cardinal Richelieu



  reply	other threads:[~2010-05-23 17:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <eMMk1-3Xc-13@gated-at.bofh.it>
     [not found] ` <eMRWq-3I8-5@gated-at.bofh.it>
2010-05-22 11:35   ` [gentoo-user] xargs and rm funkiness David W Noon
2010-05-22 12:25     ` Neil Bothwick
2010-05-23 17:51       ` Daniel D Jones [this message]
2010-05-22  1:49 Daniel D Jones
2010-05-22  2:11 ` covici
2010-05-22 16:04   ` Daniel D Jones
2010-05-22  7:46 ` Neil Bothwick
2010-05-22 18:38   ` Jan Engelhardt
2010-05-22 22:02     ` Neil Bothwick
2010-05-26 10:41   ` Joerg Schilling
2010-05-22  7:49 ` Patrick Holthaus
2010-05-26 10:42   ` Joerg Schilling
2010-05-29 15:05     ` Daniel D Jones
2010-05-29 18:04       ` Etaoin Shrdlu
2010-05-29 18:43         ` Joerg Schilling
2010-05-29 18:59       ` Alan McKinnon
2010-05-29 21:01         ` Daniel D Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201005231351.10622.ddjones@riddlemaster.org \
    --to=ddjones@riddlemaster.org \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox