私は次のようなものがあります:
find . -type f -print0 | xargs -0 file | grep Matroska | cut -d: -f 1-1 | xargs rm
私は次のようなものが欲しい:
find . -type -f -filemagic "Matroska" -delete
ベストアンサー1
bash
オプションを使用して内部およびシェル内で実行できます。たとえば、次のようになります。find
-exec
file
find . -type f -execdir bash -c 'file "$0" | grep -q Matroska && rm "$0"' {} \;