readis简单操作

查看redis进程
[imix@localhost ~]$ ps -ef|grep redis
root 22822 20246 0 22:48 pts/0 00:00:00 ./redis-server 127.0.0.1:6379
imix 74395 71731 0 22:53 pts/1 00:00:00 grep --color=auto redis
查看redis服务端口
[imix@localhost ~]$ netstat -ano |grep 6379
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN off (0.00/0/0)

进入redis目录启动redis客户端
[imix@localhost home]$ cd imix/tools/redis-3.2.10
[imix@localhost redis-3.2.10]$ ./src/redis-cli
127.0.0.1:6379>
127.0.0.1:6379> set name java [字符串]
OK
127.0.0.1:6379> get name
"java"
127.0.0.1:6379> lpush book java c++ MQ PHP C mysql  [list集合]
127.0.0.1:6379> lrange book 0 10
 1) "mysql"
 2) "C"
 3) "PHP"
 4) "MQ"
 5) "c++"
 6) "java"
 7) "java"
 8) "first"
 9) "head"
10) "the"


猜你喜欢

转载自lintaozhou.iteye.com/blog/2393170