Trying to do something like:
# redis-cli keys "resque:lock:*" |xargs -0 redis-cli del
xargs: argument line too long
What’s the best way to work around this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Get rid of the
-0. I’m not familiar with redis, but from what I can tellredis-cli keysdoesn’t use a NUL separator.The reason it barfs without it is because of the way it handles quotes. From
man xargs:Try
xargs -d '\n'. That’ll disable xarg’s “smart” quote-handling and tell it to just read arguments line by line.