created: 2024-05-06 10:57 | updated: 2024-05-06 10:57

bashで特定の文字列を含むファイルを削除するワンライナー

Terminal window
for file in *(.); do grep -q '特定の文字列' "$file" && rm "$file"; done

Backlinks