Delete keys by pattern
Safely scan-delete matching keys without KEYS command
redis-cli --scan --pattern 'cache:*' | xargs -r redis-cli DEL
More redis commands
-
redis-cli SET mykey 'value' EX 3600Set key with 1-hour expiry (EX = seconds)
-
redis-cli INCRBY counter:hits 1Atomically increment an integer counter
-
redis-cli PUBLISH events '{"type":"login","user":"alice"}'Publish a message to a Redis pub/sub channel
-
redis-cli SUBSCRIBE eventsSubscribe and listen to messages on a channel
-
redis-cli INFO replicationRole, connected replicas, replication lag