How to delete files in linux

王林
王林Original
2019-12-04 11:56:247772browse

How to delete files in linux

Use the rm command to delete files under Linux. The specific usage is as follows:

rm [选项] 文件

Option description:

How to delete files in linux

Recommended linux related video tutorials: linux video tutorial

Command examples:

1. Regularly delete a.txt file

[root]# rm a.txt

2. Forcibly delete the file .log file

[root]# rm -f file.log

3. Delete everything in the dirname directory

[root]# rm -R dir dirname

4. Delete files starting with -f

[root]# touch ./-f[root]# ls ./-f./-f[root]# rm ./-f

or use

[root]# touch -- -f [root]# ls -- -f -f[root]# rm -- -f

Recommended related articles and tutorials: 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