Home>Article>Operation and Maintenance> How to delete a folder in centos

How to delete a folder in centos

angryTom
angryTom Original
2020-03-18 17:30:12 21226browse

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!

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