tkancf.com

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

投稿日: 2024-11-28 00:25

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

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