I accidentally created more than 50K empty files in a folder. When I tried to remove them using rm -rf *.tmp, I got the error -bash: /bin/rm: Argument list too long.

It turns out bash tries to expand the * into a full list, but that list became too long.

Here is how to delete that many files:

[code] find . -name ‘*.tmp’ | xargs rm [/code]

Ref: https://yooplug.com/portal/plugin/support_manager/knowledgebase/view/45/deleting-tons-of-files-in-linux-argument-list-too/ https://www.tidyhosts.com/blog/resolve-binrm-argument-list-long-error/