How to delete a directory in centos

王林
Release: 2020-05-19 09:41:51
Original
20529 people have browsed it

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
Copy after login

2. This deletion method without parameters often prompts that it cannot be deleted because of the permissions not enough.

rm -r /home/test
Copy after login

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
Copy after login

-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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!