Saturday, January 31, 2015

Unix - Find Command Argument List Too Long

When I was trying to use the following script to find all files under a directory and perform some task, I got arg list too long error.
for i in `find $WORKDIR/*Alarm* -mtime 1 -type f`
do
some task
done
After I changed to use below script, it worked as expected.
for i in `find $WORKDIR -name ‘*Alarm*’ -mtime 1 -type f`
do
some task
done


Create a Successful Online Store at Bigcommerce! Try it Free Now!

No comments:

Post a Comment