I want to remove keys that match \"user*\".
how do I do that in redis command line?
Further to orangeoctopus' answer, you don't need the echo and pipe, you can pass commands as arguments into redis-cli. This means you can do
echo
redis-cli
for key in `redis-cli "KEYS" "user*" | awk '{print $1}'` do redis-cli "DEL" "$key" done