How to remove a non-empty directory
Stephen Liu
satimis at icare.com.hk
Tue Mar 2 06:56:58 PST 2004
Hi Jerry and other folks,
Lot of thanks for your advice on the captioned question and time spent. I
learn an alternative in removing a non-empty directory.
mc/midnight commander is a small program. It moves and removes/deletes
directory including sub-directories and files at the same. It also has
editing capability. It is a small and handy tool. I have it installed from
'PORT'.
B.R.
Stephen
On Tuesday 02 March 2004 22:28, Jerry McAllister wrote:
> > Hi all folks,
> >
> > Kindly advise where can I find the small program 'midnight commander' for
> > FreeBSD. OR what command line shall be applied on FBSD to remove a
> > non-empty directory together with its content
>
> I have never tried anything called midnight commander, but you might
> check in the ports collection. If you installed the skeleton like
> you should have, go to /usr/ports and start looking around.
>
> As for removing a non-empty directory:
>
> rm -r dirname
>
> I normally cd to the dir's parent (just above it) and do a couple
> of checks of where I am and what I am rm-ing before actually doing
> it, because once you hit enter it is gone.
>
> If you happen to have any files in that directory tree with flags
> set, especially schg, then it will not remove those, but will all
> the others. Then you would have to go in and run chflags noschg on
> those files and then go back out and run the rm -r again.
> It will ask you if it is OK to remove those files and act like it
> did, but it won't. kernel is one of those files that normally
> have schg set on it. see man chflags
>
> ////jerry
>
> > TIA
> >
> > B.R.
> > satimis
> >
> > _______________________________________________
> > freebsd-questions at freebsd.org mailing list
> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> > To unsubscribe, send any mail to
> > "freebsd-questions-unsubscribe at freebsd.org"
More information about the freebsd-questions
mailing list