tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rmdir -p



On Sun, May 18, 2008 at 09:49:29PM -0400, D'Arcy J.M. Cain wrote:
> Is the following the correct behaviour?
> 
> $ mkdir /tmp/rmdirtest
> $ mkdir /tmp/rmdirtest/x
> $ mkdir /tmp/rmdirtest/x/y
> $ touch /tmp/rmdirtest/z 
> $ rmdir -p /tmp/rmdirtest
> rmdir: /tmp/rmdirtest: Directory not empty

Yes, rmdir -p will try to go *up*, not down in the directory tree.  In your
example, "rmdir -p /tmp/rmdirtest/x/y" will remove /tmp/rmdirtest/x/y and
/tmp/rmdirtest/x but not /tmp/rmdirtest because the latter is not empty.

        Geert



Home | Main Index | Thread Index | Old Index