redis-cli do a ttl command with a pattern redis-cli do a ttl command with a pattern shell shell

redis-cli do a ttl command with a pattern


If you're using bash, be careful with globbing on "*". Also, xargs will need a replace-string like this:

redis-cli KEYS '*' | xargs -I{} redis-cli TTL {}