UNIX 檔案太多,不能刪除的問題解決(ksh: /usr/bin/find: arg list too long)

zhulch發表於2007-05-29
..........[@more@]

在UNIX 中經常由於檔案太多,進行rm 等的時候經常會出現如下錯誤.

find /OrderFulfill/*.* -mtime +1 -exec rm -f {} ;

ksh: /usr/bin/find: arg list too long

ksh: /usr/bin/rm: 0403-027 The parameter list is too long

解決方法:

) you can change the system default memory alocation

smitty System Environments

Change / Show Characteristics of Operating System

ARG/ENV list size in 4K byte blocks

you may put the value up to 256 if needed but be careful, in this case, all processes will alocate this quantity of memory. I used to change it for small periods to do cleaning scripts and put it back to it's default value after

Update the system's argument length

chdev -l sys0 -a ncargs='16' (default is 6)

I've changed all mine to 32 but 16 should be sufficient.
That fixes the problem.

"If you always do what you've always done, you will always be where you've always been."

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7318139/viewspace-916712/,如需轉載,請註明出處,否則將追究法律責任。

相關文章