Subject: Re: bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it

From: Eric Blake <[email-masked]>
Date: Fri, 07 Sep 2012 18:23:40 -0600

On 09/07/2012 06:02 PM, Linda Walsh wrote:

> The thing is, by doing rm -rf on ., I am not trying to remove . or ..
> I'm trying to remove the files in it.
> 
> Other wise there is no way to specify, using "rm" to delete the contents
> of a directory  but not the directory itself.

Yes there is, and Paul already told it to you:

rm -rf * .[!.] .??*

> 
> I just want to "clean" out a directory -- I don't want to try to delete the
> directory itself.

Then use the triple-glob.  This is portable to both POSIX and to the old
implementations we have been discussing.

-- 
Eric Blake   [email-masked]    +1-919-301-3266
Libvirt virtualization library http://libvirt.org