linux nc命令操作memcache

用nc命令操作memcached
1)存储数据:printf “set key 0 10 6\r\nresult\r\n” |nc 192.168.2.34 11211
2)获取数据:printf “get key\r\n” |nc 192.168.2.34 11211
3)删除数据:printf “delete key\r\n” |nc 192.168.2.34 11211
4)查看状态:printf “stats\r\n” |nc 192.168.2.34 11211
5)模拟top命令查看状态:watch “echo stats” |nc 192.168.2.34 11211

6)清空缓存:printf “flush_all\r\n” |nc 192.168.2.34 11211 (小心操作,清空了缓存就没了)


引用自:http://yunhaozou.org/linux/346.html

posted on 2012-02-06 17:01  雨弓  阅读(2785)  评论(0编辑  收藏  举报