查看当前库的所有key
② set test_key test_value创建一个键值对 ,test_key为键,test_value为值
③ get test_key返回test_key键的值
④ exists test_key判断这个键是否存在
⑤ move test_key 1把test_key这个键值对移动到第二个数据库,Redis默认有16个数据库
⑥ expire test_key 10给test_key这个键设置过期时间 10s
⑦ ttl test_key查看这个兼职对的过期剩余时间
⑧ type test_key查看test_key的类型
⑨ append test_key "hello word"追加命令,给test_key追加一个字符串
⑩ strlen test_key获取键 = test_key 字符串的长度
11、 步长127.0.0.1:6379> set read_num 0 ##创建一个键值对 OK 127.0.0.1:6379> type read_num string 127.0.0.1:6379> 127.0.0.1:6379> 127.0.0.1:6379> incr read_num ##键值对加1 (integer) 1 127.0.0.1:6379> incrby read_num 10 ##加10 127.0.0.1:6379> get read_num "1" 127.0.0.1:6379> decr read_num ##减1 (integer) 12 127.0.0.1:6379> decrby read_num 5 ##减5
学习redis的命令可以直接到redis官网上面查看



