redis命令之help帮助命令

运行redis-cli连接服务器。执行help

127.0.0.1:6379> help
redis-cli 3.2.6
To get help about Redis commands type:
“help @<group>” to get a list of commands in <group>
“help <command>” for help on <command>
“help <tab>” to get a list of possible help topics
“quit” to exit

To set redis-cli perferences:
“:set hints” enable online hints
“:set nohints” disable online hints
Set your preferences in ~/.redisclirc
127.0.0.1:6379>

根据输出可以看到

help命令有三种用法 “help @<group>” to get a list of commands in <group>,”help <command>” for help on <command>,”help <tab>” to get a list of possible help topics

1help @<group> 查看命令组的帮助

help @generic 查看通用组的命令包括del,dump…等等通用命令。 help @string 查看字符串组命令。还可以查看其他组的命令如

help @list help @set, help @sorted_set,help @hash 等等,查看所有的分组可以通过help <tab>提示。

127.0.0.1:6379> help @generic

DEL key [key …]
summary: Delete a key
since: 1.0.0

DUMP key
summary: Return a serialized version of the value stored at the specified key.
since: 2.6.0

EXISTS key [key …]
summary: Determine if a key exists
since: 1.0.0

EXPIRE key seconds
summary: Set a key’s time to live in seconds
since: 1.0.0

EXPIREAT key timestamp
summary: Set the expiration for a key as a UNIX timestamp
since: 1.2.0

KEYS pattern
summary: Find all keys matching the given pattern
since: 1.0.0

MIGRATE host port key| destination-db timeout [COPY] [REPLACE] [KEYS key]
summary: Atomically transfer a key from a Redis instance to another one.
since: 2.6.0

MOVE key db
summary: Move a key to another database
since: 1.0.0

OBJECT subcommand [arguments [arguments …]]
summary: Inspect the internals of Redis objects
since: 2.2.3

PERSIST key
summary: Remove the expiration from a key
since: 2.2.0

PEXPIRE key milliseconds
summary: Set a key’s time to live in milliseconds
since: 2.6.0

PEXPIREAT key milliseconds-timestamp
summary: Set the expiration for a key as a UNIX timestamp specified in milliseconds
since: 2.6.0

PTTL key
summary: Get the time to live for a key in milliseconds
since: 2.6.0

RANDOMKEY –
summary: Return a random key from the keyspace
since: 1.0.0

RENAME key newkey
summary: Rename a key
since: 1.0.0

RENAMENX key newkey
summary: Rename a key, only if the new key does not exist
since: 1.0.0

RESTORE key ttl serialized-value [REPLACE]
summary: Create a key using the provided serialized value, previously obtained using DUMP.
since: 2.6.0

SCAN cursor [MATCH pattern] [COUNT count]
summary: Incrementally iterate the keys space
since: 2.8.0

SORT key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern …]] [ASC|DESC] [ALPHA] [STORE destination]
summary: Sort the elements in a list, set or sorted set
since: 1.0.0

TTL key
summary: Get the time to live for a key
since: 1.0.0

TYPE key
summary: Determine the type stored at key
since: 1.0.0

WAIT numslaves timeout
summary: Wait for the synchronous replication of all the write commands sent in the context of the current connection
since: 3.0.0

SUBSTR key arg arg arg
summary: Help not available
since: not known

PSYNC arg arg arg
summary: Help not available
since: not known

TOUCH key arg …options…
summary: Help not available
since: not known

LATENCY arg arg …options…
summary: Help not available
since: not known

REPLCONF arg …options…
summary: Help not available
since: not known

PFDEBUG arg arg arg …options…
summary: Help not available
since: not known

ASKING arg
summary: Help not available
since: not known

PFSELFTEST arg
summary: Help not available
since: not known

RESTORE-ASKING key arg arg arg …options…
summary: Help not available
since: not known

127.0.0.1:6379> help @string

APPEND key value
summary: Append a value to a key
since: 2.0.0

BITCOUNT key [start end]
summary: Count set bits in a string
since: 2.6.0

BITFIELD key [GET type offset] [SET type offset value] [INCRBY type offset increment] [OVERFLOW WRAP|SAT|FAIL]
summary: Perform arbitrary bitfield integer operations on strings
since: 3.2.0

BITOP operation destkey key [key …]
summary: Perform bitwise operations between strings
since: 2.6.0

BITPOS key bit [start] [end]
summary: Find first bit set or clear in a string
since: 2.8.7

DECR key
summary: Decrement the integer value of a key by one
since: 1.0.0

DECRBY key decrement
summary: Decrement the integer value of a key by the given number
since: 1.0.0

GET key
summary: Get the value of a key
since: 1.0.0

GETBIT key offset
summary: Returns the bit value at offset in the string value stored at key
since: 2.2.0

GETRANGE key start end
summary: Get a substring of the string stored at a key
since: 2.4.0

GETSET key value
summary: Set the string value of a key and return its old value
since: 1.0.0

INCR key
summary: Increment the integer value of a key by one
since: 1.0.0

INCRBY key increment
summary: Increment the integer value of a key by the given amount
since: 1.0.0

INCRBYFLOAT key increment
summary: Increment the float value of a key by the given amount
since: 2.6.0

MGET key [key …]
summary: Get the values of all the given keys
since: 1.0.0

MSET key value [key value …]
summary: Set multiple keys to multiple values
since: 1.0.1

MSETNX key value [key value …]
summary: Set multiple keys to multiple values, only if none of the keys exist
since: 1.0.1

PSETEX key milliseconds value
summary: Set the value and expiration in milliseconds of a key
since: 2.6.0

SET key value [EX seconds] [PX milliseconds] [NX|XX]
summary: Set the string value of a key
since: 1.0.0

SETBIT key offset value
summary: Sets or clears the bit at offset in the string value stored at key
since: 2.2.0

SETEX key seconds value
summary: Set the value and expiration of a key
since: 2.0.0

SETNX key value
summary: Set the value of a key, only if the key does not exist
since: 1.0.0

SETRANGE key offset value
summary: Overwrite part of a string at key starting at the specified offset
since: 2.2.0

STRLEN key
summary: Get the length of the value stored in a key
since: 2.2.0

2help <command> 查看具体命令的用法

help 具体命令可以查看命令的用法描述,命令从那个版本开始,命令属于哪个组等信息。如 help keys

127.0.0.1:6379> help keys

KEYS pattern
summary: Find all keys matching the given pattern
since: 1.0.0
group: generic

127.0.0.1:6379>

3help <tab> help后面参数提示补全

help 之后按tab按键可提示参数。在命令行下 tab按键相信是用的最多的一个按键。

help空格之后一直按tab,可按顺序查看到所有可能的组和命令。也可输入需要查询的@组或命令的前缀再按tab补全。

转载请注明:求索路 » redis命令之help帮助命令

 

转载于:https://my.oschina.net/www51qiuusocom/blog/821332

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值