Skip to content

Instantly share code, notes, and snippets.

@pfigue
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save pfigue/4363f4e4f945a46736a4 to your computer and use it in GitHub Desktop.

Select an option

Save pfigue/4363f4e4f945a46736a4 to your computer and use it in GitHub Desktop.
Quick and dirty Redis Cheatsheet

Overall reference: http://redis.io/commands

Redis from bash

Install the Redis server and the CLI client:

$ sudo apt-get install redis-server

Run the client against cute-server in database 4:

$ redis-cli -h cute-server -n 4

Show all the keys in database 9 in localhost:

$ redis-cli -n 9 KEYS '*'

Redis commands in the CLI tool

Show all keys matching regexp *:

KEYS *

Retrieve content for key logstash:beaver (not for lists):

GET logstash:beaver

Retrieve elements 0 to 3 from list logstash:beaver:

LRANGE logstash:beaver 0 3

Length for list queue:

LLEN "queue"

Show all traffic the server is receiving:

MONITOR

Switch to database 14:

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