linux delete files

Under Linux deleted files with the rm command are used as follows:

rm [options] files

Option Description:

-f -force Ignore the file does not exist, force the removal, without any prompting

-i --interactive interactive deleted

-r | all directories and files in the directory -R --recursive recursively delete a listed

The step shown in detail -v --verbose

Command examples:

1, the conventional delete files a.txt

[root]# rm a.txt

2, forcibly remove the file file.log

[root]# rm -f file.log

 3, delete everything in the directory dirname

[root]# rm -R dir dirname

4, to delete files to the beginning of the -f

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

Or use

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

Editor:

https://www.cnblogs.com/scplee/p/5478992.html

Guess you like

Origin blog.csdn.net/qq_37764129/article/details/92992359