运行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 exitTo 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.0DUMP key
summary: Return a serialized version of the value stored at the specified key.
since: 2.6.0EXISTS key [key …]
summary: Determine if a key exists
since: 1.0.0EXPIRE key seconds
summary: Set a key’s time to live in seconds
since: 1.0.0EXPIREAT key timestamp
summary: Set the expiration for a key as a UNIX timestamp
since: 1.2.0KEYS pattern
summary: Find all keys matching the given pattern
since: 1.0.0MIGRATE 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.0MOVE key db
summary: Move a key to another database
since: 1.0.0OBJECT subcommand [arguments [arguments …]]
summary: Inspect the internals of Redis objects
since: 2.2.3PERSIST key
summary: Remove the expiration from a key
since: 2.2.0PEXPIRE key milliseconds
summary: Set a key’s time to live in milliseconds
since: 2.6.0PEXPIREAT key milliseconds-timestamp
summary: Set the expiration for a key as a UNIX timestamp specified in milliseconds
since: 2.6.0PTTL key
summary: Get the time to live for a key in milliseconds
since: 2.6.0RANDOMKEY –
summary: Return a random key from the keyspace
since: 1.0.0RENAME key newkey
summary: Rename a key
since: 1.0.0RENAMENX key newkey
summary: Rename a key, only if the new key does not exist
since: 1.0.0RESTORE key ttl serialized-value [REPLACE]
summary: Create a key using the provided serialized value, previously obtained using DUMP.
since: 2.6.0SCAN cursor [MATCH pattern] [COUNT count]
summary: Incrementally iterate the keys space
since: 2.8.0SORT 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.0TTL key
summary: Get the time to live for a key
since: 1.0.0TYPE key
summary: Determine the type stored at key
since: 1.0.0WAIT numslaves timeout
summary: Wait for the synchronous replication of all the write commands sent in the context of the current connection
since: 3.0.0SUBSTR key arg arg arg
summary: Help not available
since: not knownPSYNC arg arg arg
summary: Help not available
since: not knownTOUCH key arg …options…
summary: Help not available
since: not knownLATENCY arg arg …options…
summary: Help not available
since: not knownREPLCONF arg …options…
summary: Help not available
since: not knownPFDEBUG arg arg arg …options…
summary: Help not available
since: not knownASKING arg
summary: Help not available
since: not knownPFSELFTEST arg
summary: Help not available
since: not knownRESTORE-ASKING key arg arg arg …options…
summary: Help not available
since: not known127.0.0.1:6379> help @string
APPEND key value
summary: Append a value to a key
since: 2.0.0BITCOUNT key [start end]
summary: Count set bits in a string
since: 2.6.0BITFIELD 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.0BITOP operation destkey key [key …]
summary: Perform bitwise operations between strings
since: 2.6.0BITPOS key bit [start] [end]
summary: Find first bit set or clear in a string
since: 2.8.7DECR key
summary: Decrement the integer value of a key by one
since: 1.0.0DECRBY key decrement
summary: Decrement the integer value of a key by the given number
since: 1.0.0GET key
summary: Get the value of a key
since: 1.0.0GETBIT key offset
summary: Returns the bit value at offset in the string value stored at key
since: 2.2.0GETRANGE key start end
summary: Get a substring of the string stored at a key
since: 2.4.0GETSET key value
summary: Set the string value of a key and return its old value
since: 1.0.0INCR key
summary: Increment the integer value of a key by one
since: 1.0.0INCRBY key increment
summary: Increment the integer value of a key by the given amount
since: 1.0.0INCRBYFLOAT key increment
summary: Increment the float value of a key by the given amount
since: 2.6.0MGET key [key …]
summary: Get the values of all the given keys
since: 1.0.0MSET key value [key value …]
summary: Set multiple keys to multiple values
since: 1.0.1MSETNX key value [key value …]
summary: Set multiple keys to multiple values, only if none of the keys exist
since: 1.0.1PSETEX key milliseconds value
summary: Set the value and expiration in milliseconds of a key
since: 2.6.0SET key value [EX seconds] [PX milliseconds] [NX|XX]
summary: Set the string value of a key
since: 1.0.0SETBIT key offset value
summary: Sets or clears the bit at offset in the string value stored at key
since: 2.2.0SETEX key seconds value
summary: Set the value and expiration of a key
since: 2.0.0SETNX key value
summary: Set the value of a key, only if the key does not exist
since: 1.0.0SETRANGE key offset value
summary: Overwrite part of a string at key starting at the specified offset
since: 2.2.0STRLEN 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: generic127.0.0.1:6379>
3help <tab> help后面参数提示补全
help 之后按tab按键可提示参数。在命令行下 tab按键相信是用的最多的一个按键。
help空格之后一直按tab,可按顺序查看到所有可能的组和命令。也可输入需要查询的@组或命令的前缀再按tab补全。
转载请注明:求索路 » redis命令之help帮助命令