bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: slight 'rm --help' confusion


From: James Youngman
Subject: Re: slight 'rm --help' confusion
Date: Fri, 8 Apr 2005 14:09:22 +0100
User-agent: Mutt/1.3.28i

On Thu, Apr 07, 2005 at 08:45:58PM +0100, Philip Rowlands wrote:

> rmdir can still be useful as a less-dangerous alternative to rm -r;
> rmdir * will only wipe empty directories, although I was overjoyed when
> I found this worked:
> 
> $ find dirname -depth -type d -empty -exec rmdir -v -- '{}' ';'

Recent versions of findutils also allow you to do it like this:

$ find dirname -type d -delete    # -delete implies -depth

or like this:

$ find dirname -depth -type d -empty -execdir rmdir '{}' '+'

(GNU find -execdir subsitutes ./filename for {} here, so you get
"rmdir ./-rf" rather than "rmdir -rf").

Regards,
James.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]