redis-cli TTL session:abc

Category: Databases & SQL

redis-cli TTL session:abc

Show a key's remaining time-to-live

Returns seconds left until the key expires; -1 means no expiry is set, -2 means the key is gone. Related: EXPIRE.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.