I want to remove keys that match \"user*\".
how do I do that in redis command line?
Another compact one-liner I use to do what you want is:
redis-cli KEYS "user*" | xargs redis-cli DEL
Using awk, find all matching keys from redis using redis-cli KEYS command and pipe to redis-cli DEL command.
awk
redis-cli KEYS
redis-cli DEL
redis-cli KEYS "user*" | awk '{ system("redis-cli DEL " $1) }'