Home

Public Domain Photos

Free for commercial redistribution and alteration (All photo from http://publicphoto.org/ is 100% free for use)

Argument list too long ERROR

Seems rm linux command has limits (kernel limitation on the size of the parameters of the command)

linux folder listingIf you try to delete too many files in a directory at the same time and receive an error message like this:

Argument list too long

must use the following command to delete files:

find /home/mydir/ -name ‘*.ext’ -print0 | xargs -0 rm -f

or this (delete all files from folder):

find /some/path/ -type f -exec rm -f ‘{}’ \;

where:

  • -f, –force = ignore nonexistent files, never prompt
    (WARNING: be careful with this command, you can erase wrong folder/files)
  • xargs = parameter to pass the delete command
  • ext = file extension (can be * , all files )
[ Short URL ... ]

Leave a Reply

 

Powered by WordPress ::