rmdir

Originally posted by huck
I want to remove a dir and all of its contents. what is the command?

You want
rm -rf theDir
But be very very very careful with that one as it will obliterate the directory and its contents without hesitation. If you want to leave off the f it won't be as aggressive in blowing things away. But hey if your gonna do it might as well do it with conviction;)

-Eric
 
If anyone would be interested in a patented (not really), brignt, shiny PDF of the UNIX manual pages for rm and/or rmdir, just e-mail me at cheny@mn.rr.com requesting the specific file and I'll get right on it. ;-)
 
rm is the simple remove command.

rm -r is recursive and it will remove anything you ask it to and anything inside that, provided it has permission to.

rm -rf is the same as rm -r except that it doesn't ask what it's allowed to do if it has any questions, it just tries to do it any way without asking.

rm -i is interactive remove, so it asks at every item.

rm -ir is interactive and recursive, so it asks about everything, and everything inside everything.

If you're fearful about what you might be deleting, it's really useful to have it prompt you. My school aliases rm to 'rm -i' so that everyone gets interactive delete. It keeps people from shooting themselves in the foot.
 
Back
Top