Here are two quick and easy options to find out what version of the Redis client (redis-cli) you’re using.
Option 1: The HELP Command
If you’re already using redis-cli, you can run the HELP command to see what version it is:
HELP
Example result:
redis-cli 6.2.6
To get help about Redis commands type:
"help @<group>" to get a list of commands in <group>
"help <command>" for help on <command>
"help <tab>" to get a list of possible help topics
"quit" to exit
To set redis-cli preferences:
":set hints" enable online hints
":set nohints" disable online hints
Set your preferences in ~/.redisclirc
The redis-cli version is on the first line.
Option 2: Run redis-cli --version
If you’re not already using redis-cli, open a new command line and enter this:
redis-cli --version
Example result:
redis-cli 6.2.6
Alternatively, you can use the -v option (which is short for --version):
redis-cli -v
Result:
redis-cli 6.2.6
You can also incorporate the Unix cut command to remove the label if you’re so inclined:
redis-cli -v | cut -d ' ' -f2
Result:
6.2.6
And to remove the patch-level version:
redis-cli -v | cut -d ' ' -f2 | cut -d. -f-2
Result:
6.2