deleting file/directories via CL

Why would this work

rm [non-empty directory’s name] -r

…and not…

rmdir [non-empty directory’s name]-i

…or…

rmdir [non-empty directory’s name} -ir

backround:

I just downloaded and innstalled 11.2 about 6 weeks ago, and Have updated several times since… I was very frustrated and found that I did in fact have the proper pernissions to delete this directory. I checked multiple forums for much longer than I would like to admit, and they kept telling me to use (in the end) the same commands…I finally stumbled upon a forum that again told me to use rm [nonempty directory’s name] …and viola

my /bash can’t be outdated can it

please remember that I am new, and thank you to all in advance

-cheers

Because rmdir is documented to work only on an empty directory for safety reasons, whereas rm, when given -r, will delete the whole tree. A couple of things:

  1. Get into the habit of putting the options in front, thus rm -r direcory, not rm directory -r. While GNU written programs are lenient, the tradition is that options precede files, unless otherwise stated. This will help you should you need to work on more traditional Unix systems.

  2. Learn to use man to view manual pages. Thus man rmdir will show you that -r not a valid option for rmdir. Also many GNU programs accept --help as an argument to provide you with a summary of usage.

On Sat March 27 2010 08:06 pm, ken yap wrote:

>
> Because rmdir is documented to work only on an empty directory for
> safety reasons, whereas rm, when given -r, will delete the whole tree. A
> couple of things:
>
> 1. Get into the habit of putting the options in front, thus rm -r
> direcory, not rm directory -r. While GNU written programs are lenient,
> the tradition is that options precede files, unless otherwise stated.
> This will help you should you need to work on more traditional Unix
> systems.
>
> 2. Learn to use man to view manual pages. Thus man rmdir will show you
> that -r not a valid option for rmdir. Also many GNU programs accept
> --help as an argument to provide you with a summary of usage.
>
>
subcook69420;
In addition to what ken yap mentioned, “info” often gives more details
than “man”. For example:


info rmdir


P. V.
“We’re all in this together, I’m pulling for you.” Red Green