#redis-cli
12 one-liners with this tag.
All one-liners tagged redis-cli
Check whether Redis is reachable
$redis-cli -h 127.0.0.1 -p 6379 ping
Connect to Redis over a Unix socket
$redis-cli -s /run/redis/redis-server.sock ping
Count Redis keys by pattern without blocking the server
$redis-cli -n 0 --scan --pattern '*transient*' | wc -l
Count the keys in a Redis database
$redis-cli -n 0 DBSIZE
Find the biggest keys in Redis
$redis-cli -n 0 --bigkeys
Flush a single Redis database (FLUSHDB)
$redis-cli -n 0 FLUSHDB
Flush all Redis databases (FLUSHALL)
$redis-cli FLUSHALL
Show Redis memory usage and limit
$redis-cli INFO memory | grep -E '^(used_memory_human|used_memory_peak_human|maxmemory_human|maxmemory_policy|mem_fragmentation_ratio):'
Show slow Redis commands (SLOWLOG)
$redis-cli SLOWLOG GET 10
Show the Redis cache hit rate
$redis-cli INFO stats | grep -E '^(keyspace_hits|keyspace_misses|evicted_keys|expired_keys):'
Show used Redis databases and key counts
$redis-cli INFO keyspace
Watch Redis commands live for a short time (MONITOR)
$timeout 10 redis-cli MONITOR