linux command: find + rm to delete the current specified file directory and all subdirectories

linux is a find command rm deletes certain files in all subdirectories under a directory

All test.file delete files in the current directory

find .  -name "test.file" -exec rm -rf {} \;  

Detailed:

find:Linux的查找命令,用户查找指定条件的文件     
 .:当前目录    
  "test.file"":目标文件     
-exec:选项     
 rm -rf:强制删除文件,包括目录     
  {} \; :固定写法,一对大括号+空格+\
Published 254 original articles · won praise 23 · views 50000 +

Guess you like

Origin blog.csdn.net/qq_30242987/article/details/104750558