Delete many files in linux

Hello,

Very often we want to delete many files in linux and see the following error:

-bash: /bin/rm: Argument list too long

Изтриване на много файлове в linux

In this case, the problem is solved by combining the find and rm commands, that is :

find . -type f -exec rm -v {} \;

But if the files are millions, it will give the same mistake.

That’s why there’s a faster and more effective way to erase everything :

find . -type f -delete

And if we want to see what we’re doing, let’s run the command here :

find . -type f -print -delete