/bin/rm : Argument list too long

I was trying to delete the files in the folder that has more than 90,000. When I delete the files, I had errors

% /bin/rm : Argument list too long

The issue is that there are too many files and rm is not able to clear. To workaround the issues, you can do the following. Make sure you are in the directory where you want to clear the file.

 % find . -name '*' | xargs rmfind . -name '*' | xargs rm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.