Home>Article>Operation and Maintenance> How to delete a folder in centos
How to delete a folder in CentOS
To delete a folder in Linux, use the rmdir command, but you can only delete folders with empty directories, so The commonly used command is rm, the specific method is as follows:
1. Delete folder command:
rm /home/test
2. Delete with parameters
(1) rm -r /home/ test
The -r parameter is to recursively delete the directory and its subdirectories in the parameter table.
The directory will be cleared and deleted. The user is usually prompted when deleting a directory containing write-protected files.
(2) rm -rf /home/test
-f does not prompt the user and deletes all files in the directory. Need to pay attention to check the path
(3) rm -ir /home/test
-i is interactive mode. With this option, the rm command prompts the user for confirmation before deleting any files.
This article comes from the PHP Chinese website,CentOS usage tutorialcolumn, please pay attention to this column for more related tutorials!
The above is the detailed content of How to delete a folder in centos. For more information, please follow other related articles on the PHP Chinese website!