How to delete files in linux

王林
王林Original
2020-05-14 10:09:493394browse

How to delete files in linux

You can use the rm command to delete files. The usage method is:

rm -rf 目录名字

Parameter introduction:

-r is downward recursion, no matter how many there are Level-level directories are deleted together;

-f means direct forcible deletion without any prompt;

Example:

Delete folder:

rm -rf /var/log/httpd/access

The /var/log/httpd/access directory and all files and folders under it will be deleted.

Delete 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 How 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