answersLogoWhite

0


Best Answer

The easiest way is to use the 'rm' command recursively. For example, the command:

rm -rf /data/test/docs/fall

would remove the directory 'fall' from /data/test/docs, even if it isn't empty.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: In Unix how to remove a directory that is not empty?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can command rmdir can be used to delete a directory that is not empty?

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


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.


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

rmdir


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


How do you remove directory which is not empty?

rm -r directoryname this will remove the directory recursively, mean all the files and directories in the specified directory name umar, pakistan


What is Topmost directory in unix?

Root directory.


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


How does Unix work as a multi-user operating system?

When a user logs in to a Unix system, the current working directory normally starts at the directory/file


What command is used to list the contents of a directory recursively in Unix?

ls -lR directory


What is the command that will change the current default directory to the root directory in Unix?

CD /


What is the Unix command to display the filesizes of a directory?

Once your in the directory you have to type the following: du -a


How is Topmost directory in unix represented?

Directory tree structure in Unix always starts at the top node, or "root" node. It contains all of the major level subdirectories underneath it. The root directory is called "/" (root).