1.一種
telnet localhost 11211 #登陸
stats #查看狀態
flush_all #清理
quit #退出
2.又學到一個:
echo 'flush_all' | nc localhost 11211
3.
1、數據存儲(假設key為test,value為12345)
printf "set test 0 1 5\r\n12345\r\n" | nc localhost 11211
STORED
2.數據取回(假設key為test)
printf "get test\r\n" | nc localhost 11211
VALUE test 0 5
12345
?END
?3.數據增加1(假設key為test并且value為正整數)
?printf "incr test 1\r\n" | nc localhost 11211
123456
?4.數值減少3(假設key為test,并且value為正整數)
printf "decr test 3\r\n" | nc localhost 11211
5.數據刪除(假設key為test)
printf "delete test\r\n" | nc localhost 11211
DELETED
?6.查看Memcached狀態
?printf "stats\r\n" | nc localhost 11211
?7.模擬top命令,查看Memcached狀態:
printf "stats\r\n" |nc localhost 11211