1.先把要删除的keys保存到一个文件
2.通过cat查询文件内的key
cat test.txt |xargs -i /data/redis/bin/redis-cli -p 6389 keys {}
3.通过cat删除文件内的key
cat test.txt |xargs -i /data/redis/bin/redis-cli -p 6389 del {}
本文转自 shouhou2581314 51CTO博客,原文链接:http://blog.51cto.com/thedream/1705130,如需转载请自行联系原作者