Linux中国 Linux中国门户站!
设为主页 设为主页
收藏本站 收藏本站
 
当前位置 :首页 ->Linux技术 ->系统管理 ->正文

解决文件过多而不能删除的问题

来源:Linux-cn.com 作者:Webmaster 时间:2007-05-05 点击: [收藏] [投稿]

Hi, This isn't a real bug, but I thought I'd better mention it anyway as I've hit it a few times now. I guess it stems from the days when storage was rare and memory rarer.

Basically, I've occasionally have problems with the limit imposed by the "*" operator when handling files. E.g.


[tonyl@saturn 2002-replaced]$ rm -f *
bash: /bin/rm: Argument list too long

[tonyl@saturn 2002-replaced]$ ls | wc -l
 231937 (yeah yeah I know!)

[tonyl@saturn 2002-replaced]$ ls * | wc -l
bash: /bin/ls: Argument list too long

In this case I can simple delete the dir and recreate it. The situation has only come to light since moving a process off an NT box onto a GNU/Linux samba combo.

I find it interesting that the `ls' works for an obscene number of files, yet `ls *' doesn't. bash fails nicely as above, but /bin/sh either returns "Segmentation fault" or kills my connection!

Any ideas (other than "don't get involved with legacy systems that store lots of files in a single dir")?




 如果您对本文有任何疑问或者建议,请到讨论区发表您的意见: >> 论坛入口 <<



上一篇:Linux/Unix下串行通信调试工具sct 1.04版简介   下一篇:我的qmail+vpopmail+igenus的安装历程

文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【我要投稿】 【论坛讨论
更多相关文章
Power by linux-cn.com 粤ICP备05006655号