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

From: Christopher Howard <christopher.howard@frigidcode.com>
Date: Thu May 26 2011 - 18:59:28 AKDT

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.

-- 
frigidcode.com
theologia.indicium.us
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Thu May 26 18:59:12 2011

This archive was generated by hypermail 2.1.8 : Thu May 26 2011 - 18:59:12 AKDT