Skip to content
SRE运维进阶之路SRE运维进阶之路
github icon

    键命令

    author iconClaycalendar icon2021年5月11日category icon
    • Redis
    timer icon小于 1 分钟

    # 键命令

    • 查找键 参数⽀持正则表达式
    keys pattern
    
    1
    • 判断键是否存在, 如果存在返回1,不存在返回0
    exists key
    
    1
    • 查看键对应的value的类型
    type key
    
    1
    • 删除键
    del key1 key2 ...
    
    1
    • 设置过期时间

    以秒为单位,如果没有指定过期时间则⼀直存在,直到使⽤DEL移除

    expire key seconds
    
    1
    • 查看有效时间

    以秒为单位

    ttl key
    
    1
    edit icon编辑此页open in new window
    上次编辑于: 2021/5/11 03:54:51
    贡献者: clay-wangzhi
    备案号:冀ICP备2021007336号
    Copyright © 2023 Clay