查找以 ~$ 开头的文件(Microsoft Word 临时文件)

Nic*_*ick 3 find regular-expression

出于某种原因,我的机器装满了 M$ Word 临时文件,例如:

~$Filename.docx  
~$AnotherFile.docx
Run Code Online (Sandbox Code Playgroud)

有人可以建议使用 find/regex 命令来搜索 $HOME 并删除它们吗?

Chr*_*own 5

在 bash 4 或更高版本中:

shopt -s globstar
rm ~/**/'~$'*
Run Code Online (Sandbox Code Playgroud)

在 zsh 或 ksh93 中,您可以rm直接使用上面的行。