0
我的目录中有几个文本文件需要删除。有在我的目录一堆文本文件:在perl中使用find和rm删除多个文件
leaves_emp1.txt
pay_emp1.txt
pf_emp1.txt
leaves_emp2.txt
pay_emp2.txt
pf_emp2.txt
[...]
我用下面的代码删除含有“EMP1”文件的尝试:
/usr/bin/find $LogDir -name \"leaves_emp1.txt\" -and -name \"pay_emp1.txt\" -and -name \"pf_emp1.txt\" -exec rm {}
但它无法正常工作。请帮忙。我尝试了-a和-o。我也尝试使用()作为文件。
我已经用perl重新标记了,因为你显然想在perl脚本中运行这个 - 是吗? – fugu
是的。但我找到了一个办法。我只是使用-name \“* emp1.txt \”。谢谢。 – user3164754
你很迷惑 - 和 - 或。 – Ingo