2013-01-06 32 views

回答

18

首先,你可以使用一個簡單的find命令:

find . -type f -name '*~' -delete 
0

方式一:

find folder -name '*~' -print0 | xargs -0 rm -f 

基本上,看 「人找到」

0

首先,你是什麼通過遞歸意味着什麼?遞歸是實現圓頂算法的一種便捷方式,但往往被過度使用 - 但有些人也將該術語應用於搜索目錄樹(可以通過遞歸的其他方式來實現)。如果你只是想刪除一個目錄樹,然後匹配到一個特定的glob所有文件....

find /base/directory/ -type f -iname '*~' -exec rm -f {}\; 

(但你可能想用find /base/directory/ -type f -iname '*~' -exec ls -l {}\;第一實驗)。