linux howto ya ek..

find . -name *.log : xargs rm
was the way I was going to go, but then it said
-bash: /usr/bin/find: Argument list too long
rm: too few arguments

I also tried
mv *.log /dev/null
which generated a similar error.

Silly me, I thought it was rm that was complaining when it was in fact bash!!
Obviously the string that bash generates by expanding wildcard ‘*.log’ is too long for it to pass to any command.
Just like Juri said it is a shell limitation.I have looked, but havent seen any options or shell variables that would let me up this limit.

So I escaped the wildcard and let ‘find’ handle it by
find . -name ‘*.log’ : xargs rm
which did it.

Bir yanıt yazın