web-dev-qa-db-ja.com

osx find exec rm find:exec:不明なプライマリまたは演算子

削除したい「-e」で終わるファイルがたくさんあります。

$ find . -name "*-e" exec rm {} \;
find: exec: unknown primary or operator

正規表現は、すべてを台無しにする何らかの形で拡大していますか?

22
freedrull

そのはず:

find . -name "*-e" -exec rm '{}' \;

またはそれ以上:

find . -name "*-e" -exec rm '{}' +

man find

-exec utility [argument ...] {} +
   Same as -exec, except that ``{}'' is replaced with as many pathnames as possible for 
   each invocation of utility. This behaviour is similar to that of xargs(1).
34
anubhava