Turns out there is a limit on the length of a bash command. To find out the maxlength on your system go to the console and:
$ getconf ARG_MAX 262144
The other day when I was trying to delete (rm -rf
) a very large folder with lots & lots of files the bash returned the following error:
/bin/rm: cannot execute [Argument list too long]
It’s because the bash was trying to expand the entire command with a list of files (arguments) it has to delete before executing. That list of files was too long and exceeded ARG_MAX.