vim rename.txt
rename ONLINE:CHAT:219:10003594:DEFAULT ONLINE:COMMONCHAT:219:10003594:DEFAULT
rename ONLINE:CHAT:219:10003573:153969 ONLINE:COMMONCHAT:219:10003573:153969
rename ONLINE:CHAT:219:10003578:DEFAULT ONLINE:COMMONCHAT:219:10003578:DEFAULT
rename ONLINE:CHAT:219:10003586:200430 ONLINE:COMMONCHAT:219:10003586:200430
rename ONLINE:CHAT:219:10003589:DEFAULT ONLINE:COMMONCHAT:219:10003589:DEFAULT
rename ONLINE:CHAT:219:10003590:188204 ONLINE:COMMONCHAT:219:10003590:188204
rename ONLINE:CHAT:219:10003570:50893661 ONLINE:COMMONCHAT:219:10003570:50893661
cat rename.txt | redis-cli -a password -n 12 --pipe
批量删除key
redis-cli --scan --pattern users:* | xargs redis-cli del
Redis版本为4.0或者更高,还可以使用unlink
命令来替代del
命令:
redis-cli --scan --pattern users:* | xargs redis-cli unlink
网友评论