Solved: ‘/bin/rm: Argument list too long’ error

I faced this issue while I was removing huge list of files from a folder using
sudo rm -rf /folder/some-filename-2017*

Take a count of file in the folder:
ls techlogs/ | wc -l

Upon googling found following command, that fixed my issue.

cd /folder
sudo find . -name 'some-filename-2017*'
Above command will list all files start with “some-filename-2017”

sudo find . -name 'some-filename-2017*'| xargs rm 
Above command will delete all files start with “some-filename-2017”

 

Author: Danyal
I'm skilled programmer with expertise in Vue.js/Nux.js for front-end development and PHP Laravel for back-end development. I excel in building APIs and services, and also have experience in web server setup & maintenance. My versatile skill set allows you to develop and maintain web applications effectively, from the user interface to the server-side functionality. I love coding with never ending learning attitude, thanks for visiting danya.dk