启动redis /usr/local/bin/redis-server /usr/local/redis/conf/redis.conf
找到redis-cli
find -name redis-cli
进入redis命令行
[root@RDCentOS04 bin]# redis-cli
127.0.0.1:6379>
选择redis库
127.0.0.1:6379> select 1
OK
查看1库下面所有的key
127.0.0.1:6379[1]> keys *
1) "session.g0ejehnh8kh36b48mcv9v9h6o5"
2) "5bcdd3322561a4543366e5c86c4245f0"
查看当前库下key的总数
127.0.0.1:6379[1]> dbsize
(integer) 2
转载于:https://blog.51cto.com/jinliang/1620120