redis cheatsheet

install

wget http://download.redis.io/releases/redis-2.6.16.tar.gz
tar xzf redis-2.6.16.tar.gz 
cd redis-2.6.16/
sudo make PREFIX=/opt/redis-2.6 install
cd /opt/
sudo ln -s redis-2.6 redis

## add redis bin to $PATH, add the following lines to ~/.bashrc
if [ -d /opt/redis/bin ]; then
    PATH=/opt/redis/bin:$PATH
fi

test run

$ redis-server &
$ redis-cli 
redis 127.0.0.1:6379> set name lee
OK
redis 127.0.0.1:6379> get name
"lee"
redis 127.0.0.1:6379>