The best Redis command Tutorial In 2024, In this tutorial you can learn Execute commands on remote service,
Redis commands for performing operations on a redis service.
To execute a command requires a client on redis redis service. Redis client before we redis downloaded the installation package.
The basic syntax Redis client is:
$ redis-cli
The following example explains how to start redis client:
Start redis client, open a terminal and enter the commandredis-cli.This command will connect local redis service.
$redis-cli redis 127.0.0.1:6379> redis 127.0.0.1:6379> PING PONG
In the above example we connect to the local redis service and execute thePING command, which is used to detect redis service is started.
If you need to execute commands on a remote redis service is alsoredis-cli command we use.
$ redis-cli -h host -p port -a password
The following example demonstrates how to connect to the host 127.0.0.1, port 6379, the password on mypass redis service.
$redis-cli -h 127.0.0.1 -p 6379 -a "mypass" redis 127.0.0.1:6379> redis 127.0.0.1:6379> PING PONG