Click here for "Safe Air Conditioner Repair and Proper Freon Recovery".(Japanese Version)

Delete the directory (and everything in it)

Delete the directory (and everything in it)

To remove a directory, the rmdir command is usually used. However, if the directory contains files, they cannot be removed with the rmdir command.

If you want to delete all files in a directory, you can use the rm command with the option -r.

[nuy@Lion nuy]$ ls -lR samp_dir
samp_dir:
合計 0
-rw-r--r-- 1 nuy nuy 0 Feb 5 09:52 rm_file   ← Check that there are files in the directory
[nuy@Lion nuy]$ rmdir ./samp_dir/
rmdir: `./samp_dir': directory is not empty  ← run the rmdir command
[nuy@Lion nuy]$ rm -r ./samp_dir/ ← use "rm -r" to remove whole directories at once
Copied title and URL