bug-coreutils
[Top][All Lists]
Advanced

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

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


From: Eric Blake
Subject: bug#12339: Bug: rm -fr . doesn't dir depth first deletion yet it
Date: Fri, 07 Sep 2012 18:23:40 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0

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   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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