linux delete directory is very simple, many people are still accustomed to use rmdir, but once the directory is non-empty, it is in deep distress, now use rm -rf command can be. Directly rm can be, but to add two parameters -rf that is: rm -rf directory name -r is the downward recursion, no matter how many levels of directories, and delete them all together -f means to forcibly delete the directory without any prompts.
Example of deleting a folder: rm -rf /var/log/httpd/access will delete the /var/log/httpd/access directory and all files and folders under it.
Delete file usage examples: rm -f /var/log/httpd/access.log will force the file /var/log/httpd/access.log to be deleted.
Be very careful when using rm -rf, linux doesn't have a recycle bin. Many people do not see this important message before using it, so it is very difficult to retrieve it after deleting it.
|