Skip to content

Instantly share code, notes, and snippets.

@jczaplew
Last active March 17, 2016 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jczaplew/013054fb863b6429502e to your computer and use it in GitHub Desktop.
Save jczaplew/013054fb863b6429502e to your computer and use it in GitHub Desktop.
Redis cheatsheet

Standard port: 6379

Config file:

  • Homebrew - /usr/local/etc/redis.conf
  • Macports - /opt/local/etc/redis.conf

Start redis

redis-server [path to config file]

Stop redis

redis-cli shutdown nosave/save

Check if redis is running

redis-cli ping

Set an item

set foo 'bar'

Get an item

get foo

Delete an item

del foo

Clear database

flushdb or flushall

Check memory usage

redis-cli info | grep used_memory_human

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment