How to sort out - bash: /bin/rm: Argument list too long

Опубликовано: 05 Май 2026
на канале: Bobby Iliev
2,487
19

When running `rm *` in a directory that contains a lot of individual files might get the following error:

bash: /bin/rm: Argument list too long

There are a few ways to delete the files inside that specific directory:

You could delete the whole folder
You could the find command - this is my personal favorite
Or use a for loop - much slower!

Here’s how to do that!

I use DigitalOcean for all of my demos, you can use the link below to get a free $100 credit and spin up your own Linux servers!

https://m.do.co/c/2a9bba940f39

Website: https://bobbyiliev.com
Twitter:   / bobbyiliev_