Questions tagged [redis-cli]

redis-cli is the command line interface that is installed when installing Redis.

redis-cli 3.0.5

Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]]]
  -h <hostname>      Server hostname (default: 127.0.0.1).
  -p <port>          Server port (default: 6379).
  -s <socket>        Server socket (overrides hostname and port).
  -a <password>      Password to use when connecting to the server.
  -r <repeat>        Execute specified command N times.
  -i <interval>      When -r is used, waits <interval> seconds per command.
                     It is possible to specify sub-second times like -i 0.1.
  -n <db>            Database number.
  -x                 Read last argument from STDIN.
  -d <delimiter>     Multi-bulk delimiter in for raw formatting (default: \n).
  -c                 Enable cluster mode (follow -ASK and -MOVED redirections).
  --raw              Use raw formatting for replies (default when STDOUT is
                     not a tty).
  --no-raw           Force formatted output even when STDOUT is not a tty.
  --csv              Output in CSV format.
  --stat             Print rolling stats about server: mem, clients, ...
  --latency          Enter a special mode continuously sampling latency.
  --latency-history  Like --latency but tracking latency changes over time.
                     Default time interval is 15 sec. Change it using -i.
  --latency-dist     Shows latency as a spectrum, requires xterm 256 colors.
                     Default time interval is 1 sec. Change it using -i.

  --lru-test <keys>  Simulate a cache workload with an 80-20 distribution.

  --slave            Simulate a slave showing commands received from the master.
  --rdb <filename>   Transfer an RDB dump from remote server to local file.
  --pipe             Transfer raw Redis protocol from stdin to server.
  --pipe-timeout <n> In --pipe mode, abort with error if after sending all data.
                     no reply is received within <n> seconds.
                     Default timeout: 30. Use 0 to wait forever.
  --bigkeys          Sample Redis keys looking for big keys.
  --scan             List all keys using the SCAN command.
  --pattern <pat>    Useful with --scan to specify a SCAN pattern.
  --intrinsic-latency <sec> Run a test to measure intrinsic system latency.
                     The test will run for the specified amount of seconds.
  --eval <file>      Send an EVAL command using the Lua script at <file>.
  --help             Output this help and exit.
  --version          Output version and exit.

Examples:
  cat /etc/passwd | redis-cli -x set mypasswd
  redis-cli get mypasswd
  redis-cli -r 100 lpush mylist x
  redis-cli -r 100 -i 1 info | grep used_memory_human:
  redis-cli --eval myscript.lua key1 key2 , arg1 arg2 arg3
  redis-cli --scan --pattern '*:12345*'

  (Note: when using --eval the comma separates KEYS[] from ARGV[] items)

When no command is given, redis-cli starts in interactive mode.
Type "help" in interactive mode for information on available commands.
278 questions
0
votes
1 answer

How to sort by duplicates only

I am designing a system were every song a user plays will get logged in my redis DB. I am then creating a Top Played section on the app. The app will index my DB and pull back the most played tracks (In other words, the tracks with the most…
William
  • 1,009
  • 15
  • 41
0
votes
1 answer

node child_process not writing everything to stdout

I'm trying to use node's spawn/exec functions from the child_process module. But I'm noticing a strange difference between what I see in a real terminal and on the command line. Here's an example: Terminal: $ redis-cli 127.0.0.1:6379> hmset hash…
user1002973
  • 2,088
  • 6
  • 22
  • 31
0
votes
0 answers

Redis Instance in Azure Seems to delete keys automatically

We are trying to benchmark performance of Redis in Azure. To that end, we created a Premium Tier Redis node in Azure, and are trying to put simple Key-value pairs. We have tried both Jedis and Redis-cli. When we are actually running these, we are…
D159
  • 243
  • 1
  • 3
  • 11
0
votes
1 answer

Launching redis-server with the Latest Version

I've downloaded Redis 3.2.5 which has the functionality for PFADD and I intend on using it. Initially, I used to simply type redis-server in my root directory and it used to launch in the version 2.6.9. After a little searching, I found out that…
Augmented Jacob
  • 1,567
  • 19
  • 45
0
votes
3 answers

Redis - data structure to insert string one by one and remove all at once

I am new to Redis and found that there are various data structures supported in Redis and based on requirement we can choose any one of them. My requirement is to insert strings one by one to a list(key-list) and wants to retrieve(and remove) all at…
RaR
  • 3,075
  • 3
  • 23
  • 48
0
votes
2 answers

keys command behavior on redis vs redis cluster on aws

kinda newbie on redis... I've noticed a weird behavior on redis.. When I'm running redis locally, & using the command 'keys *' - I get\see all of the keys in the system- which is alright and according to the documentation. When I run redis in a…
soBusted
  • 197
  • 3
  • 18
0
votes
1 answer

Can I make alias commands on redis-cli?

I have the impression Im always typing again and again the same commands ZRANGE mykey 0 100 WITHSCORES and it is quite repetitive as I have to juggle between maps, sets, and sorted sets (and the client is not great, I can't use the same shortcuts…
Thomas
  • 8,306
  • 8
  • 53
  • 92
0
votes
0 answers

Redis Persistence Partial

I have multiple keys in redis most of which are insignificant and can be lost in case my redis server goes down. However I have one or two keys, which I cannot afford to lose. Hence I would like that whenever the server restarts, redis reads only…
Dipanshu Verma
  • 459
  • 3
  • 8
  • 22
0
votes
0 answers

Getting incorrect index when using redis-cli -pipe to read a csv file

I am using this tutorial to read a CSV file using redis-cli -pipe. The structure of my csv file is: 0, col1 , col2 , col3 ,......., col20 1,11222323, random- , ----ww ,......., text and so on Now, I am running this command: awk -F,…
delalli
  • 67
  • 2
  • 11
0
votes
1 answer

how to view decoded messagepack data in redis-cli

i have data stored in redis in messagepack. How to view the data decoded in redis-cli. I don't see any commands related to it.
Krishna Deepak
  • 1,735
  • 2
  • 20
  • 31
0
votes
1 answer

Pushing a JSON payload to redis via Ruby and redis-cli

I am trying to have a Ruby script lpush a json payload to redis via redis-cli, but somehow I'm not getting the quotes right: timestamp = `date +%s.%N`.strip jid = `cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 24 | head -n 1`.strip json =…
Jochen
  • 1,853
  • 3
  • 20
  • 28
0
votes
0 answers

redis bitcount example not working

I was playing with redis and tried the bitcount example: http://redis.io/commands/bitcount . 127.0.0.1:6379> SET mykey "foobar" OK 127.0.0.1:6379> BITCOUNT mykey (error) ERR unknown command 'BITCOUNT' my redis version are as follows: mohit@mohit:~$…
Mohit
  • 891
  • 10
  • 25
-1
votes
1 answer

In redis, how to remove a particular value for a key

I have below values for key google.com, how can I delete 109 from the table? I tried with del command, but it deletes all values. 127.0.0.1:6379> hgetall google.com 1) "57" 2) "58" 3) "109" 4) "258" 5) "414" 127.0.0.1:6379> del google.com…
Q.W.
  • 122
  • 1
  • 10
-1
votes
1 answer

How to search whole redis database for string?

I need to debug a session problem, so I have to search for a certain string in the whole redis database. Is this possible?
Black
  • 18,150
  • 39
  • 158
  • 271
-1
votes
1 answer

redis,set a value to 3,but its type is string

I use redis 6.2.4,in the redis-cli i input command: 127.0.0.1:6379> set k5 3 OK 127.0.0.1:6379> type k5 string 127.0.0.1:6379> why the type of k5 is string but not number?
vlddlv4
  • 35
  • 4
1 2 3
18
19