Linux - Usr bin find argument list too long, Unable to remove files list too long
Usr bin find argument list too long
When I was trying to find and remove particular files from a directory, I was unable to remove those files from directory and I received the error as /usr/bin/find argument list too long. I executed the below command.# find ./ -name '*.log' -mtime +10 -exec rm {} \;This error is because the proper arguments are not passed correctly to the remove command and also the argument list is too long and hence the arguments are not passed.
In order to overcome such scenario you can use the below command's
# find /var/log/httpd/ -type f -name '*.log' -mtime +10 -exec ls -ltr {} \;This command will ensure that all the arguments are passed properly and those files are listed with last access time
Command to remove the files accessed before 10 days
# find /var/log/httpd/ -type f -name '*.log' -mtime +10 -exec rm {} \;When you receive the error /usr/bin/find argument list too long. You can try this command to overcome such issue.
The topic on Linux - Usr bin find argument list too long is posted by - Math
Hope you have enjoyed, Linux - Usr bin find argument list too longThanks for your time