Deleting a directory in linux is very simple. Many people are still used to using rmdir. However, once the directory is not empty, it is deeply worried. Now we can use the rm-rf command.
You can simply use rm, but you need to add two parameters-rf: rm-rf directory name
-R is recursive down. No matter how many levels of directories are there, delete them together.
-F means to delete the file directly without any prompts.
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.
Note that you must be extremely careful when using this rm-rf. linux has no recycle bin.
Of course, rm has more parameters and usage, and man rm can be viewed.
Delete a file instance:
Rm-f/var/log/httpd/access. log
The file/var/log/httpd/access. log will be forcibly deleted.
Rename a folder
Mv oldfilename newfilename