brew install redis
redis-server
sudo dfn install -y redis6
sudo systemctl enable redis6
sudo systemctl start redis6
Either ctrl-c the redis server process, or
redis-cli
> shutdown
sudo systemctl stop redis6
redis-cli
> slowlog get 10
Start the redis client with:
redis-cli monitor
or
telnet localhost 6379
> MONITOR
Use the first option.
> help <tab>
> help @set
Don’t do this in production
KEYS my:prefix:*
lpush mylist "foo1" "foo2" "foo3"
lrange mylist 0 -1
lpush mylist "a" "b"
brpoplpush mylist processinglist 0
lrange processinglist 0 -1
# => "a"
lrange mylist 0 -1
# => "b"
del mylist
Careful with this one.
for key in `echo 'KEYS <my-namespace>:*' | redis-cli | awk '{print $1}'`; do echo DEL $key; done | redis-cli
Or wipe everything out. Be even more careful with this one:
$ redis-cli
> shutdown
> exit
$ locate dump.rdb
$ rm <location>