how to delete all matching keys in redis on teminal

70 views Asked by At

i want to delete keys with matching pattern directly from the redis-cli terminal not running cmd on bash script as given in this thread

/home/ubuntu> redis-cli -h 10.244.0.85
10.244.0.85:6379>             --> what should i type here to delete all keys with test* pattern
10.244.0.85:6379>

i am using redis-cli version 5.0.7.

moreover as given solution which is expected to work on bash shell is also not working in my case. so how to make it run in bash ?

/home/ubuntu>redis-cli -h 10.244.0.85   --scan --pattern  "{e2Manager},RAN*"  | xargs redis-cli -h 10.244.0.85 DEL 
(error) ERR wrong number of arguments for 'del' command
/home/ubuntu>
 
0

There are 0 answers