如何使用 Linux shell 递归删除包含给定字符串的所有文件
此命令将递归删除包含 abc123abc 的所有文本文件:
remove_files.sh
ag abc123abc --hidden -l | xargs rm -v我未测试包含空格等的文件名。文件将被永久删除,所以先尝试只使用
output.txt
ag abc123abc --hidden -lCheck out similar posts by category:
Linux
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow