Collapse

Announcement

Collapse
No announcement yet.

/bin/rm: Argument list too long

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • /bin/rm: Argument list too long

    When you have too many files in a directory and you are unable to delete them with a simple "rm -f *" command on linux servers.

    For e.g. I was trying to delete all the files under /var/spool/clientmqueue/ folder, but getting below error:

    Code:
    [root@ip-172-30-0-250 clientmqueue]# rm -f *
    -bash: /bin/rm: Argument list too long
    Then, I have used the following loop command to forcefully delete all files in the mentioned directory:

    Code:
    [root@ip-172-30-0-250 clientmqueue]# for i in `find /var/spool/clientmqueue/ -type f`; do rm -f $i; done
    Try this and let us know if you have any issues.
Working...
X