Summary of common Redis commands and common redis commands

Source: Internet
Author: User
Tags echo message

Summary of common Redis commands and common redis commands
Service command:
• BGREWRITEAOF asynchronously rewrite the append object
• BGSAVE asynchronously saves the dataset to the disk
• Client kill ip: port closes CLIENT Connection
• Client list to obtain the CLIENT connection LIST
• Client pause timeout pause client commands
• Client getname obtains the name of the current connection
• Client setname connection-name sets the name of the current connection
• Config get parameter GET the Configuration parameter Value
• Config rewrite configuration files written from memory
• Config set parameter value obtains the value of the Configuration parameter
• Config resetstat reset redistribution statistics reported using the info command
• DBSIZE returns the number of keys in the current database
• The debug object key obtains the debug information of a key.
• Debug segfault causes server crash
• FLUSHALL clears all databases
• FLUSHDB clears the current database
• INFO [section] to obtain server details
• LASTSAVE gets the last Disk Synchronization time
• MONITOR the server in real time
• SAVE to synchronize data to the disk
• SHUTDOWN [NOSAVE] [SAVE] Shut down the service
• SLAVEOF host port specifies the master server of the current server
• SLOWLOG subcommand [argument] manages distributed slow query logs
• SYNC Internal commands used for replication
• TIME returns the current server TIME

Connection command:
• AUTH password verification Server
• ECHO message ECHO the input string
• PING the server
• QUIT closes the connection and exits

• SELECT index SELECT database

Key Value command:
• DEL key [key...] delete a key
• DUMP key export key value
• EXISTS key query whether a key EXISTS
• EXPIRE key seconds: set the number of seconds when a key expires.
• EXPIREAT key timestamp sets the expiration time of a UNIX timestamp
• KEYS pattern searches for KEYS that match the given pattern
• MIGRATE host port key destination-db timeout atomically moves the key from one apsaradb for redis instance to another
• MOVE key db MOVE one key to another database
• OBJECT subcommand [arguments [arguments...] Check the internal redistribution OBJECT
• PERSIST key: expiration time of the key to be removed
• PEXPIRE key milliseconds sets the number of milliseconds when a key expires.
• PEXPIREAT key milliseconds-timestamp sets the expiration time of a UNIX timestamp with milliseconds
• The number of valid milliseconds for the PTTL key to obtain the key
• RANDOMKEY returns a random key
• RENAME key newkey RENAME a key
• RENAMENX key newkey rename a key. The new key must be a non-existent key.
• RESTORE key ttl serialized-valueCreate a key using the provided serialized value, previously obtained using
• SCAN cursor [MATCH pattern] [COUNT count] incremental iteration key
• SORT key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern...] [ASC | DESC] [ALPHA]
[STORE destination] sorts queues, sets, and ordered sets.
• The effective time for the TTL key to obtain the key (unit: seconds)
• TYPE key: The storage TYPE for obtaining the key

Script command:
• EVAL script numkeys key [key...] arg [arg...] Run The LUA script on the server.
• EVALSHA sha1 numkeys key [key...] arg [arg...] Run The LUA script on the server.
• Script exists script [script...] Check existence of scripts in the script cache.
• Script flush deletes all Lua scripts in the server cache.
• Script kill kills the currently running Lua SCRIPT.
• Script load script loads a Lua SCRIPT from the server cache.

Transaction command:
• DISCARD discards all the commands sent after MULTI
• EXEC execute all the commands sent after MULTI
• MULTI indicates the start of a transaction Block
• UNWATCH cancels the transaction
• WATCH key [key...]: Lock the key until the MULTI/EXEC command is executed.

Publish subscription command:
• PSUBSCRIBE pattern [pattern...] Listen to Publishing messages that match the channel of a given pattern
• PUBLISH channel message publishes a message to the channel
• PUBSUB subcommand [argument [argument...] check the status of the Pub/Sub Subsystem
• PUNSUBSCRIBE [pattern [pattern...] stops Publishing messages to a channel that matches a given pattern
• SUBSCRIBE channel [channel...] Listen to messages from the publishing channel
• UNSUBSCRIBE [channel [channel...] messages of the stop publishing channel

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.