answersLogoWhite

0


Best Answer
the commandrmdir will not remove a directory if it is not empty in UNIX. The correct way to

remove a directory and all its contents recursively is with the rm

command.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Can command rmdir can be used to delete a directory that is not empty?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the command is used to remove directory in Linux?

Assuming the directory is in your Home directory use: rmdir directory-name This will fail if there are files within the directory. In this case, use rm -r directory-name.


What does the rmdir -rf quake command do in Linux?

It would delete the directory ./quake, and all of it's contents.


Which two commands can you use to delete directories?

AFAIK there's only one command to delete a directory. "rmdir" Removes the directory. If you only want to delete the content of the directory you can use "del <dir name>"


Why did the rmdir command fail's that a directory bar exists. The command rmdir bar fails with the message that the directory is not empty. On running ls bar no files are displayed?

This could mean that the directory named bar has hidden contents. Use ls -a bar to show all contents of bar.


What command would you use to remove a directory on a UNIX server?

If you are just removing the directory, use the command: rmdir dir-name The dir-name directory has to be empty for this to work. If there are files or other subdirectories then use the command: rm -rf dir-name


In recovery console what command deletes a directory?

Rmdir or Rd


Which Windows command will delete a directory as well as all its files and subdirectories?

RMDIR /S rmdir /? Removes (deletes) a directory. RMDIR [/S] [/Q] [drive:]path RD [/S] [/Q] [drive:]path /S Removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree. /Q Quiet mode, do not ask if ok to remove a directory tree with /S


Which command would you use to remove a directory on a UNIX server?

rmdir


What are five unix commands?

cp - copy a file rm - delete a file mv - rename a file mkdir - create a directory rmdir - remove a directory etc...


DOS command to delete a directory?

1) When in DOS at the C:/, type RD (remove directory)2) hit Enter keyC:/C:/RDEnter


How do you delete a folder from command prompt?

In Dos-just write (DEL Folder Name) this command will delete all the Files inside that folder,then write (RD Folder Name) This will Remove your Folder. Remember both command contain Same folder name. Which you want to Delete.(DEL)command is used to delete Files. (RD) command is used to delete Folder


What command is used to create a suddirectory and change the current directory and to remove a subdirectory?

If for example we wanted to make i subdirictory called foo in Linux or UNIX it you use mkdir foo to change into it you would use CD foo to remove the directory rmdir foo but this will only work if the directory is empty to remove the directory called foo when it is not empty use rm -rf foo but please be sure this is what you really want to do.