Linux deleting directories is very simple, many people are still used to using rmdir, but once the directory is not empty, they fall into deep distress, and now use the rm -rf command.
Just rm is fine, but you need to add two parameters -rf, namely: rm -rf directory name
-r is a downward recursion, no matter how many levels of directories there are, they are deleted
-f means to forcibly delete it directly without any prompting
Delete a folder instance:
rm -rf /var/log/httpd/access
The /var/log/httpd/access directory and all files and folders under it will be deleted
Delete a file usage example:
rm -f /var/log/httpd/access.log
The /var/log/httpd/access.log file will be forcibly deleted
You must be extra careful when using this rm -rf, linux does not have a recycle bin Many friends do not see this important reminder information before using it, so it is difficult to get it back after deletion
|