Home  >  Article  >  Operation and Maintenance  >  What is the command to delete files in linux

What is the command to delete files in linux

王林
王林Original
2020-05-15 14:20:348329browse

What is the command to delete files in linux

#The command to delete files in Linux is rm, which can also delete directories.

Parameter introduction:

-i Ask for confirmation one by one before deleting.

-f Even if the original file attribute is set to read-only, it will be deleted directly without confirming one by one.

-r Delete the files in the directory and below one by one.

Example:

1. Delete folder example:

rm -rf /var/log/httpd/access

will delete the /var/log/httpd/access directory and all files and folders under it.

2. Example of deleting files:

rm -f /var/log/httpd/access.log

will forcefully delete the file /var/log/httpd/access.log.

Recommended tutorial: linux tutorial

The above is the detailed content of What is the command to delete files in linux. 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