[aklug] Re: Linux/BSD: Why do directories need to be empty?

From: Shane R. Spencer <shane@bogomip.com>
Date: Fri May 27 2011 - 08:25:38 AKDT

On 05/26/2011 06:59 PM, Christopher Howard wrote:
> On 05/26/2011 07:35 AM, Jim MacDonald wrote:
>> actually as far as I know this has been the default of RM for as long as =
>> I have been a unix admin. That's what the -f is for=85 forced. It's =
>> supposed to override this condition and delete it anyway.
>>
>> Jim MacDonald
>> jim@macdonald.org
>>
>>
>>
>
> Not to talk like the young know-it-all, but that is not the purpose or
> the effect of the -f flag. Even if the -f flag is used, the -r flag must
> still be used to "remove directories and their contents recursively",
> according to RM(1). The -f flag only causes rm to "ignore nonexistent
> files" and "never prompt".
>
> Or at least, that is definitely the current state of things (on my
> Gentoo box). Now, if their is a BSD rm that behaves differently, or an
> older Linux that did that, I'd be quite interested to hear about it.
>
> What started this whole thread is that I tried to use rm -rf on a
> directory, and the command failed because there was a file in one
> sub-directory that was read only.

So it failed.. I'd fail to.. to let you or a script know that it failed to do EXACTLY what
you asked it to do.

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Fri May 27 08:25:48 2011

This archive was generated by hypermail 2.1.8 : Fri May 27 2011 - 08:25:49 AKDT