2009年9月27日星期日

Argument list too long error in shell and solution

use cmd "getconf ARG_MAX" to get this limit

this macro is defined in "include/linux/limits.h"

 

solution:

1. 

find /path/ |xargs -n 100 rm

 

2. 

for fileset in a b c d e f g h i j k l m n o p q r s t v w x z
do
   /bin/rm $fileset*
done

 

3.

ls|xargs rm

 

4. modify kernel at "include/linux/binfmts.h"

#define MAX_ARG_PAGES 32      // modify 32 to larger

 

没有评论: