How to remove a non-empty directory
jerrymc at clunix.cl.msu.edu
Tue Mar 2 06:28:10 PST 2004
> 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
> freebsd-questions at freebsd.org mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
More information about the freebsd-questions