rmdir

from Wikipedia, the free encyclopedia

rmdiror rd(from English: remove directory ) is a command line program under different operating systems, with which you can delete a (mostly: empty) directory.

POSIX

rmdir only deletes empty directories. The rm command is required to delete any directory recursively .

 rm -r foo/bar/baz
 rm -rf foo/bar/baz

With the -p option , the directories above are also deleted if they are also empty.

Example:

 rmdir -p foo/bar/baz

first deletes baz /, then bar / and finally foo /, i.e. the complete directory tree.

DOS / Windows

In DOS, there is a DELTREE command for the recursive deletion of directories including the files they contain . Under Windows there is the switch / s :

 rd /s [Laufwerk:]Verzeichnisname
 rmdir /s [Laufwerk:]Verzeichnisname

Web links