In computing, rmdir (or rd) is a command which will remove an empty on various operating systems. The command is available in Unix (e.g. macOS, Solaris, AIX, HP-UX), Unix-like (e.g. FreeBSD, Linux), DOS, Digital Research FlexOS, IBM OS/2, Microsoft Windows or ReactOS operating systems. On MS-DOS, the command is available in versions 2 and later. DR DOS 6.0 also includes an implementation of the command. It is also available in the open source MS-DOS emulator DOSBox and in KolibriOS. The numerical computing environments MATLAB and GNU Octave include an rmdir function with similar functionality. Normal usage is straightforward: 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 -rf foo/bar/baz Normal usage is identical to Unix-like operating systems:
rmdir name_of_directory The equivalent command in MS-DOS 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 case insensitive, 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 Windows Registry settings are set to allow it.