请输入您要查询的百科知识:

 

词条 Rmdir
释义

  1. Usage

     Unix, Unix-like  DOS, OS/2, Windows, ReactOS 

  2. See also

  3. References

  4. External links

{{lowercase}}{{Infobox Software
| name = rmdir / rd
| logo =
| screenshot =
| screenshot size =
| caption =
| developer =
| released =
| latest release version =
| latest release date =
| operating system = Unix and Unix-like, DOS, FlexOS, OS/2, Microsoft Windows, ReactOS
| genre = Command
| license =
| website =
}}

rmdir (or rd) is a command which will remove an empty directory on a Unix (e.g. macOS, Solaris, AIX, HP-UX), Unix-like (e.g. FreeBSD, Linux), DOS, FlexOS[1], OS/2, Microsoft Windows[2] or ReactOS operating system.

The command is also available in the open source MS-DOS emulator DOSBox.

Usage

Unix, Unix-like

Normal usage is straightforward:

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:

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 rm 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:

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

In later version of Windows:

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.

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 malware. 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

References

1. ^http://www.bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf
2. ^[https://technet.microsoft.com/en-us/library/cc754993.aspx Microsoft TechNet Rmdir article]

External links

  • {{man|cu|rmdir|SUS}}
{{Unix commands}}{{Windows commands}}

5 : Unix SUS2008 utilities|Unix file system-related software|Internal DOS commands|OS/2 commands|Windows administration

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/13 7:52:46