Dotlayer
  • News
  • Startups
  • Tutorials
  • SEO
  • Marketing
  • Interviews
No Result
View All Result
Dotlayer
  • News
  • Startups
  • Tutorials
  • SEO
  • Marketing
  • Interviews
No Result
View All Result
Dotlayer
No Result
View All Result

How to Delete a Folder With a Lot of Files in Linux i.e Argument List Too Long Error

March 16, 2020
in Tutorials
0 0
Share on FacebookShare on Twitter

If you have ever had to delete a lot of files within a folder and files on every variant of Linux using the remove command, you might have seen the error below. In this article, we are going to try other approaches to fix this error and you safely and quickly delete files and folder on Linux.

/bin/rm: Argument list too long.

The problem is that when you type something like rm -rf *, the * is replaced with a list of every matching file, like rm -rf file1 file2 file3 file4 and so on.

There is a relatively small buffer of memory allocated to storing this list of arguments and if it is filled up, the shell will not execute the program.

To get around this problem, a lot of people will use the find command to find every file and pass them one-by-one to the rm command like this:

find . -type f -exec rm -v {} \;

There is another approach we want to talk about now. Using this new method, We can delete at a rate of about 2000 files/second which is much much faster! You can also show the filenames as you’re deleting them:

find . -type f -print -delete

We hope this tip will come in handy when you have to delete a folder with a lot of files.

ShareTweetPin
Previous Post

How to Encrypt & Decrypt Files from the Command Line with OpenSSL on Mac and Linux

Next Post

Easy SEO Hacks to Optimize Mobile Marketing

Next Post
Easy SEO Hacks to Optimize Mobile Marketing

Easy SEO Hacks to Optimize Mobile Marketing

You might also like

Calendarific Unveils New Pricing Plans

Calendarific Unveils New Pricing Plans

July 27, 2023
CurrencyBeacon vs. Currency Freaks, Fixer.io, and OpenExchangeRates: Which API is Best?

CurrencyBeacon vs. Currency Freaks, Fixer.io, and OpenExchangeRates: Which API is Best?

June 17, 2023
Mint Linux vs Ubuntu: Which is Right For You?

Mint Linux vs Ubuntu: Which is Right For You?

March 12, 2022
Net Neutrality: What is it and Why Should You Care?

Net Neutrality: What is it and Why Should You Care?

March 12, 2022
Solid State Drives – Why You Should Buy One Today

Solid State Drives – Why You Should Buy One Today

March 12, 2022

Machine Learning Algorithms Every Beginner Should Know

January 25, 2022
  • Terms of Service
  • Privacy Policy
  • Careers

© 2021 Dotlayer.com

No Result
View All Result
  • About Us
  • Advertise
  • Blog
  • Careers
  • Contact
  • Contact Us
  • Get Featured
  • Home Layout 1
  • Home Layout 2
  • Home Layout 3
  • Privacy Policy
  • Security
  • Services
  • Subscribe To Dotlayer
  • Terms of Service
  • Write For Us

© 2021 Dotlayer.com

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In