root@ubuntu:/home/kyl# pwd
/home/kyl
root@ubuntu:/home/kyl# cd /usr/local/bin
root@ubuntu:/usr/local/bin# pwd
/usr/local/bin
root@ubuntu:/tmp# redis-server /myredis/redis.conf
root@ubuntu:/tmp# redis-cli -p 6379
127.0.0.1:6379> config get dir
1) "dir"
2) "/usr/local/bin"
127.0.0.1:6379> SHUTDOWN
not connected> exit
root@ubuntu:/tmp# cd /home/kyl
root@ubuntu:/home/kyl# redis-server /myredis/redis.conf
root@ubuntu:/home/kyl# redis-cli -p 6379
127.0.0.1:6379> config get dir
1) "dir"
2) "/home/kyl"
127.0.0.1:6379> SHUTDOWN
not connected> exit
root@ubuntu:/home/kyl# cd /tmp
root@ubuntu:/tmp# redis-server /myredis/redis.conf
root@ubuntu:/tmp# redis-cli -p 6379
127.0.0.1:6379> config get dir
1) "dir"
2) "/tmp"
即就是进入到哪个目录下,再启动服务