Use the rm command to delete files under Linux. The specific usage is as follows:
rm [选项] 文件
Option description:
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!