Created
August 14, 2018 06:04
-
-
Save ayuLiao/729e77e35a2421d642e271422b40cbc0 to your computer and use it in GitHub Desktop.
删除redis中的key,其实也把redis中的值删除了,通过一句shell命令则可以做到
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-a:redis密码 | |
-n:选择Redis中哪个数据库 | |
keys:找出符合语法的redis key | |
通过管道,使用xargs将搜索到的key传递给redis,进行删除 | |
redis-cli -a Fkkg65NbRwQOnq01OGMPy5ZREsNUeURm -n 1 keys gold:canjoin:room:*:*:set | xargs redis-cli -a Fkkg65NbRwQOnq01OGMPy5ZREsNUeURm -n 1 del |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment