You can use the rm command to delete a directory.
The rm command is used to delete a file or directory.
The specific usage is as follows:
1. Delete the test directory under the home directory
rm /home/test
2. This deletion method without parameters often prompts that it cannot be deleted because of the permissions not enough.
rm -r /home/test
3. -r recursively deletes 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.
rm -rf /home/test
-4. f does not prompt the user and deletes all files in the directory. Please pay attention to check the path, it will be tragic if you enter it in another directory.
rm -ir /home/test
5. -i is interactive mode. With this option, the rm command prompts the user for confirmation before deleting any files.
Recommended tutorial: centos tutorial
The above is the detailed content of How to delete a directory in centos. For more information, please follow other related articles on the PHP Chinese website!