このコマンドはDWIM規格に準拠していません。
find . \( -name .svn -prune -false \) -o \( -empty -delete \)
find: The -delete action atomatically turns on -depth, but -prune
does nothing when -depth is in effect. If you want to
carry on anyway, just explicitly use the -depth option.
-depth
効果を追加すると、効果は無効になります-prune
。つまり、.svn
ディレクトリも削除されます。find
したがって、他のツールを使用せずに一部の非トリムパスをトリミングしてから削除するために使用できる構文(存在する場合)は何ですかrm
?
ベストアンサー1
を使用できます-path
。 POSIXではありませんが、多くの実装でサポートされています。
find . \! -path "*/.svn/*" -empty -delete
-regex
またオプションです。