Home >Operation and Maintenance >CentOS >How to delete a directory in centos

How to delete a directory in centos

王林
王林Original
2020-05-19 09:41:5120594browse

How to delete a directory in centos

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn