using different database at redis command prompt
Just use the -n argument to choose DB number. It available since Redis 2.4.2. echo -n “testing” | redis-cli -n 4 -x set my_pass or redis-cli -n 4 set my_pass testing
Just use the -n argument to choose DB number. It available since Redis 2.4.2. echo -n “testing” | redis-cli -n 4 -x set my_pass or redis-cli -n 4 set my_pass testing
Another compact one-liner I use to do what you want is: redis-cli KEYS “user*” | xargs redis-cli DEL
Try to look at KEYS command. KEYS * will list all keys stored in redis. EDIT: please note the warning at the top of KEYS documentation page: Time complexity: O(N) with N being the number of keys in the database, under the assumption that the key names in the database and the given pattern have … Read more