Set key with TTL

Set key with 1-hour expiry (EX = seconds)

redis-cli SET mykey 'value' EX 3600

tool
redis32 commands
tags
redis

More redis commands

  • redis-cli INCRBY counter:hits 1

    Atomically increment an integer counter

  • redis-cli PUBLISH events '{"type":"login","user":"alice"}'

    Publish a message to a Redis pub/sub channel

  • redis-cli SUBSCRIBE events

    Subscribe and listen to messages on a channel

  • redis-cli INFO replication

    Role, connected replicas, replication lag

  • redis-cli BGSAVE && redis-cli LASTSAVE

    Trigger background RDB save and check its timestamp

all 32 redis commands