First execute the sudo command or su command to enter the root mode;
Then use the rm (abbreviation for remove) command to delete the folder. If you are prompted that you cannot delete a Directory, then use the following command:
(Recommended learning video: linux video tutorial)
1. rm -r Directory/file name: Use recursive deletion.
2. rm -rf directory/file name: Completely delete the folder.
3. rm -ir directory/file name: interactively delete files.
Recommended related tutorials: CentOS usage tutorial
The above is the detailed content of How to delete files in centos7. For more information, please follow other related articles on the PHP Chinese website!