Divi WordPress Theme

Topic: /bin/rm: Argument list too long  (Read 7770 times)

Offline HRamesh

  • New Member
  • *
  • Posts: 34
  • iTrader: +0/-0
    • View Profile
/bin/rm: Argument list too long
« on: October 16, 2008, 10:22:11 PM »
Hi,

I am getting /bin/rm: Argument list too long error while deleting files using below command:

rm -rf somenane*

Any help would be appreciated.

Ramesh
VPS Hosting - AccuWebHosting

Offline Kailash

  • Web Hosting Master
  • *****
  • Administrator
  • Posts: 604
  • iTrader: +153/-0
    • View Profile
Re: /bin/rm: Argument list too long
« Reply #1 on: October 17, 2008, 01:00:16 AM »
It seems that the total number of files are high. You can check it using the following command:

ls -l | wc -l

Try to delete in a batch (500/1000 files) at a time.

Kailash

Offline jantillon

  • Newbie
  • *
  • Posts: 1
  • iTrader: +0/-0
    • View Profile
Re: /bin/rm: Argument list too long
« Reply #2 on: July 23, 2010, 05:38:51 AM »
If you are absolutely sure that you want to remove everything in the directory use xargs.  

find . -name '*' | xargs rm

Or add a filestring to the wildcard
« Last Edit: July 23, 2010, 05:42:25 AM by jantillon »

hmb-willem

Re: /bin/rm: Argument list too long
« Reply #3 on: January 28, 2016, 01:57:38 PM »
You can also remove the files in alphabets order.
Divi WordPress Theme
Tags: