Bash bin rm Argument list too long!

Its quite possible that you face issues  and  getting the following error message while removing the files in bulk using the “rm” command:

Error :
====
root@server [/tmp]# rm -rf *
-bash: /bin/rm: Argument list too long
====

Then you can use the following “find | rm” command combination as given below in order get done this task :

find . -name ‘<pattern>’ | xargs rm

<patern> = Any matching file pattern that you want remove/delete.

Thats it.


Bash bin rm Argument list too long!, Hostripples Web Hosting
HR-ADMIN