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/filename*

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 'filenames*'
Above command will list all files start with “filenames”

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

Such as –

You have  huge files which file names started with ‘abc’, Then you will write the command –

sudo find . -name 'abc*'| xargs rm 

 

Leave a Reply

Your email address will not be published. Required fields are marked *