Redis Commands

Redis server commands

  • Start redis-server
    • redis-server
  • Start redis-server in background
    • sudo service redis-server start
  • Stop
    • sudo service redis-server stop
  • Restart
    • sudo service redis-server restart

Redis CLI Commands

  • How to open redis-cli
    • type “redis-cli” in terminal
  • Get information about redis server
    • type command “info
      • info clients
      • info memory
      • info cpu
      • info cluster
      • info stats
  • ping
    • To check if the redis is alive
  • lolwut
    • LOLWUT command displays the Redis version
  • set foo 42
    • Set key value pair
  • get foo
    • Get the value of a key
  • del foo
    • Delete a key
  • exists foo
    • To check if a key exits
  • shutdown
    • Use to shutdown redis server from redis-cli
    • shutdown [NOSAVE|SAVE]

Leave a Comment