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.
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.
To remove a directory that must be empty of files, you can use the command rmdir <directory_name> in a Unix/Linux terminal. This command will only succeed if the specified directory is empty; if it contains any files or subdirectories, an error will be returned. If you want to ensure that a directory is empty before attempting to remove it, you can use commands like ls <directory_name> to check its contents.
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.
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
rmdir
rm -r directoryname this will remove the directory recursively, mean all the files and directories in the specified directory name umar, pakistan
Root directory.
cp - copy a file rm - delete a file mv - rename a file mkdir - create a directory rmdir - remove a directory etc...
When a user logs in to a Unix system, the current working directory normally starts at the directory/file
ls -lR directory
CD /
Once your in the directory you have to type the following: du -a