One linux Command every day (6): rmdir command link: One linux Command every day (1): ls command http://www.bkjia.com/ OS /210210/163049.html#linuxlinuxcommand every day (2): cd command serial (3 ): pwd command kernel (4): mkdir command http://www.bkjia.com/ OS /201210/1620.3.html#a linuxlinuxcommand every day (5): rm command http://www.bkjia.com/ OS /201210/163662.html yesterday learned to create files and directories command rm, today learn the linux Command: rmdir command. Rmdir is a common command used to delete an empty directory. A directory must be empty before it is deleted. (Note that the rm-r dir command can replace rmdir, but it is highly risky .) When deleting a directory, you must also have the write permission on the parent directory. 1. command Format: rmdir [Option]... directory... www.2cto.com 2. command function: This command deletes one or more sub-directory items from a directory. to delete a directory, you must have the write permission on the parent directory. 3. Command Parameter:-p recursively deletes the directory dirname. When the subdirectory is deleted and its parent directory is empty, it is also deleted. If the entire path is deleted or some paths are retained for some reason, the system displays the corresponding information on the standard output. -V, -- verbose shows the Command Execution Process 4. command instance: instance 1: rmdir cannot delete non-empty directory command: rmdir doc output: [root @ localhost scf] # tree. www.2cto.com | -- bin | -- doc | -- info | '-- product | -- lib | -- logs | -- info |' -- product' -- service' -- deploy | -- info '-- product12 directories, 0 files [root @ localhost scf] # rmdir docrmdir: doc: the directory is not empty [root @ localhost scf] # rmdir doc/info [root @ localhost scf] # rmdir doc/product [root @ localhost scf] # tree. | -- bin | -- doc | -- lib | -- logs | -- info | '-- product' -- service' -- deploy | -- info' -- product10 directories, 0 files description: run the "www.2cto.com rmdir directory name" command to delete non-empty directory instance 2: rmdir-p. If the subdirectory is deleted and becomes an empty directory, delete the directory together with the command: rmdir-p logs output: [root @ localhost scf] # tree. | -- bin | -- doc | -- lib | -- logs | '-- product' -- service' -- deploy | -- info' -- product10 directories, 0 files [root @ localhost scf] # rmdir-p logsrmdir: logs: the directory is not empty [root @ localhost scf] # tree. | -- bin | -- doc | -- lib | -- logs | '-- product' -- service' -- deploy | -- info' -- product9 directories, 0 files [root @ localhost scf] # rmdir-p logs/product [root @ localhost scf] # tree. | -- bin | -- doc | -- lib '-- service' -- deploy | -- info' -- product7 directories, 0 files