启动redis /usr/local/bin/redis-server /usr/local/redis/conf/redis.conf
找到redis-cli
find -name redis-cli
进入redis命令行
[[email protected] 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) "cribn.hsns.session.g0ejehnh8kh36b48mcv9v9h6o5"
2) "cribn.hsns.5bcdd3322561a4543366e5c86c4245f0"
3) "cribn.hsns.0a28ade61326dd457279553866d54dad"
4) "cribn.hsns.01a5a42c12a9649d525b936beddcf087"
5) "cribn.hsns.a8975cd71aa3a48de86a43076886b5be"
6) "cribn.hsns.413ae7d6f143aac41756cfb3805ba634"
7) "cribn.hsns.7d283d2b9a903eced1c73e2818b73e90"
8) "cribn.hsns.f9c228f53ec7504e8aabc5040d9a4cab"
9) "cribn.hsns.5d8a9c4e7ba76c5a82c37b5d85ce6519"
10) "cribn.hsns.session.1npnde9d547ck36vhhamnqsm82"
11) "cribn.hsns.a4725fb26f713859e64abb6955cd2c05"
12) "cribn.hsns.8df49fc8505afabe67deb57fbc18b3ac"
13) "cribn.hsns.b1b38d6668a5c00e90c945561f3ae5e9"
14) "cribn.hsns.1299832f72f75ed137f478498130cd3f"
查看当前库下key的总数
127.0.0.1:6379[1]> dbsize
(integer) 14