I recently got the error “Argument list too long” when trying to remove many files in a folder:
1 2 |
$ rm *
bash: /bin/rm: Argument list too long |
Simple solution:
If all the files do not contain whitespace or special chars, this will work:
1 |
ls | xargs rm |
Otherwise you you need a solution with special handling of filenames.