How to delete files in linux

王林
Release: 2019-12-04 11:56:24
Original
7706 people have browsed it

How to delete files in linux

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

rm [选项] 文件
Copy after login

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
Copy after login

2. Forcibly delete the file .log file

[root]# rm -f file.log
Copy after login

3. Delete everything in the dirname directory

[root]# rm -R dir dirname
Copy after login

4. Delete files starting with -f

[root]# touch ./-f[root]# ls ./-f./-f[root]# rm ./-f
Copy after login

or use

[root]# touch -- -f [root]# ls -- -f -f[root]# rm -- -f
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template