This is a problem we’ve run into repeatedly with asterisk recordings files. The directories get so full of files that rm, ls, cp, etc cannot deal with them.
for x in *; do rm -f "$x"; done
or
for x in *; do cp "$x" "/<Destination Directory>/$x"; done
Linux / UNIX : Argument list too long error in shell and solution | Frequently Asked Questions
Posted by Pat McKay 


