Questions? Feedback? powered by Olark live chat software
Knowledgebase
Author Avatar

Deleting Large Number of Files in SSH

Written by: on 09 September 2014 11:03 AM 09 September 2014 11:03 AM

Know the command to delete an unlimited number of files in the fastest manner.

In SSH you may find a circumstance where you want to delete more than the allowed number of files. In this case you would get the error: Argument list too long

To delete an unlimited number of files in the fastest manner use this command:

find /folder -print0 | xargs -0 rm -f

This would delete all files in /folder. 

Replace /folder with the full path to the folder containing the files you want removed.

(0 vote(s))
Helpful
Not helpful