Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Mar 1999 15:28:27 -0500 (EST)
From:      "Crist J. Clark" <cjc@cc942873-a.ewndsr1.nj.home.com>
To:        gjb@comkey.com.au (Greg Black)
Cc:        chris@tci.com, mikegoe@ibm.net, freebsd-questions@FreeBSD.ORG
Subject:   Re: /var -- Device Busy
Message-ID:  <199903082028.PAA23450@cc942873-a.ewndsr1.nj.home.com>
In-Reply-To: <19990308190831.7072.qmail@alpha.comkey.com.au> from Greg Black at "Mar 9, 99 05:08:30 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Greg Black wrote,
> > > Hmmm...I've always used rm -r to remove
> > > directories...didn't even realize there was a rmdir
> > > command...I guess there's many ways to do the same thing...
> > > :)
> > 
> > Are you sure you weren't using rm -rf?
> 
> Do the following and answer your own question:
> 
>     mkdir testdir
>     touch testdir/file
>     rm -r testdir 
> 
> Of course, if you are not root and if some elements in the tree
> are read-only, then you'll get asked about them without the -f
> flag -- but the -f flag will not allow you to rm anything that
> you could not rm without using -f (which means that -f has no
> meaning when used by root).

Not true. The '-f' flag will prevent error messages about files that
do not exist as well as cause 'rm' to exit on a 0 in such a situation.
This can be important in scripts and makefiles.

And to the makefile writers who think the '-f' option on 'mv' does the
same thing, it does _not._
-- 
Crist J. Clark                           cjclark@home.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903082028.PAA23450>