Product Code Database
Example Keywords: kindle -trousers $67
barcode-scavenger
   » » Wiki: Rmdir
Tag Wiki 'Rmdir'.
Tag

In computing, rmdir (or rmdir) is a command which will remove an empty directory on various .


Implementations
The command is available in (e.g. , Solaris, , ), (e.g. , ), , , OS/2, Microsoft Windows or operating systems. On , the command is available in versions 2 and later.
(2026). 9780735618121, .
DR DOS 6.0 also includes an implementation of the command.

It is also available in the MS-DOS and in . The numerical computing environments and include an rd function with similar functionality.


Usage

Unix, Unix-like
Normal usage is straightforward:

$ rmdir name_of_directory

where name_of_directory corresponds with the name of the directory one wishes to delete. There are options to this command such as -p in Unix which removes parent directories if they are also empty.

For example:

$ rmdir -p foo/bar/baz

will first remove baz/, then bar/ and finally foo/ thus removing the entire directory tree specified in the command argument.

rmdir will not remove a directory if it is not empty in UNIX. The command will remove a directory and all its contents recursively. For example:

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


DOS, OS/2, Windows, ReactOS
Normal usage is identical to Unix-like operating systems:

>rmdir name_of_directory

The equivalent command in and earlier (non-NT-based) versions of Microsoft Windows for deleting non-empty directories is .

In later version of Windows:

>rd /s directory_name

Windows based on the NT kernel (XP, Vista, 7, 8, Server 2003/2008) are , just like their earlier predecessors, unless two files of the same name and different case exist. Then case sensitivity applies when selecting which file to use, or if the case does not match either file, one may be chosen by Windows.

Having two files named the same with different case sensitivity is allowed either when Windows Services for Unix is installed or when the settings are set to allow it.

An example of the security risk is:

Using rd/rmdir and two directories with the same name and different case sensitivities exist, one of which contains valid data and/or programs, and the other contains incriminating materials and/or . If rd/rmdir gets executed without regard to case sensitivity and Windows chooses the legitimate folder to delete, the only folder left is the undesired one. Windows then uses this folder instead of the previously legitimate one to execute programs, and one may be led to believe it contains legitimate data.


See also
  • List of Unix commands
  • List of DOS commands


Further reading


External links

Page 1 of 1
1
Page 1 of 1
1

Account

Social:
Pages:  ..   .. 
Items:  .. 

Navigation

General: Atom Feed Atom Feed  .. 
Help:  ..   .. 
Category:  ..   .. 
Media:  ..   .. 
Posts:  ..   ..   .. 

Statistics

Page:  .. 
Summary:  .. 
1 Tags
10/10 Page Rank
5 Page Refs