How to delete large amount of files in Linux

banner dedicated


In this tutorials, we will show you how to delete a large amount of files in Linux
if you receive this error when using rm -rf command : “Argument list is too long”.
You can use the command “find” to delete the files.


How to delete large amount of files with the command find

Go in the directory where the files are

cd /directory/of/the/files/


Use this command to remove the files

find . -type f -delete


Add the -print option to see the files you are deleting

find . -type f -print -delete


The process can take a long time if you have a very large amount of files to delete.


banner dedicated


Colo-Serv Communications has written 32 articles

Premium Dedicated Hosting Services