redis-cli
, the Redis command line tool, is a quick shortcut for running the most common operations that require our everyday job. Let's review them in a nutshell:
To open a server session, run the console command:
shell> redis-cli -h <hostname>
The password can be specified in the above command by setting the
-a <password>
argument, but for security reasons it's better to authenticate once in the redis-cli
console:
redis> AUTH [username] password
Again from the console, to check if one ore more keys exist:
redis> EXISTS <key> [<key> ...]
To search keys matching a given pattern:
redis> KEYS <pattern>
To get an entry value given its key:
redis> GET <key>
To delete an entry given its key:
redis> DEL <key>
To quit the
redis-cli
session:
redis> EXIT
Lastly, to access to the
redis-cli
command reference click here.
Comentarios
Publicar un comentario