Thanks for visiting the site !!! Visit below intrested Ads to support us if you like the site .Sharing is caring .keep distance and keep safe . Happy Learning ... 😀

redis-server & –> to run Redis on the background

Redis running on standalone mode and listening on 6379 port .

A command-line interface to send commands to Redis .It has two modes.1)Command line mode 2)Interactive mode

Command-line — > useful for testing and scripts

$ redis-cli GET mycounter
(integer) 8

Interactive –> responses simpler to read

$ redis-cli
PONG> connect metal 6379

metal:6379> PING

Note:  <host>:<port> of connected Redis instance . In the above example it is

By default redis-cli connects to port 6379) (use -p to specify an alternate port)

$ redis-cli -h   PING PONG

use -a option to specify the password in the command line itself

 $ redis-cli -a <password>  PING 

Auto-complete> Z&> ZADD=

Running same command N times> 2 INCR mycounter (integer) 1 (integer) 2>

Command history and help> help> help Categories include: @generic, @list, @set, @sorted_set, @hash, @pubsub, @transactions, @connection, @server, @scripting, @hyperloglog

Create a key/value pair

Run the set command and pass the {key} and {value} as parameters


Query by key name
Run the get command and pass the {key} as a parameter

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *