原贴:http://www.zhangjianfeng.com/?p=358
删除文件时,报"-bash: /bin/rm: Argument list too long"错误.查了一下,
[root@srv1 mqueue]# ls -l |wc -l
319913
应该是文件数量太大了吧,记得应该是shell的限制,rm mv cp都受此限制。
解决方法:find所有文件,然后送给rm删除.
find /var/spool/mqueue -type f -exec rm {} /;
<script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </script> name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/cpa/ads?client=ca-pub-9932809095109167&cpa_choice=CAEaCG25ta-KCIutUBJQBVAtUAdQQ1AvUEdQAw&oe=utf-8&dt=1190277355781&lmt=1190277355&format=468x60_as&output=html&correlator=1190277355765&channel=9299699904&url=https%3A%2F%2Fptop.only.wip.la%3A443%2Fhttp%2Fwww.zhangjianfeng.com%2F%3Fp%3D358®ion=_google_cpa_region_&ref=https%3A%2F%2Fptop.only.wip.la%3A443%2Fhttp%2Fwww.google.cn%2Fsearch%3Fcomplete%3D1%26hl%3Dzh-CN%26ie%3DGB2312%26q%3Dlinux%2Brm%2Bargument%2Btoo%2Blong%26btnG%3DGoogle%2B%25CB%25D1%25CB%25F7%26meta%3D%26aq%3Dnull&cc=100&ga_vid=636176395.1190277356&ga_sid=1190277356&ga_hid=2072357979&flash=9&u_h=1024&u_w=1280&u_ah=904&u_aw=1280&u_cd=32&u_tz=480&u_java=true" frameborder="0" width="468" scrolling="no" height="60" allowtransparency="allowtransparency">
##最后修改日期, Thursday, October 12th, 2006 2:30 pm##
2007年09月
以root身份进入/var/spool/clientmqueue/
执行:
ls|xargs rm -f 就能全部删除了
这样效率比较高