Getting started with Redis--redis common commands

Source: Internet
Author: User
Tags delete key redis

The common commands of Redis are divided into two main parts, one is the key-value related command, the other is the server-related command

1. Key-Value related commands

Keys * Take out all current key

exists name to see if n has name this key

Del name Delete key name

Expire Confirm 100 setting confirm this key100 second expires

TTL confirm gets the effective duration of this key confirm

Select 0 Choose to 0 database redis default database is 0~15 altogether 16 databases

Move confirm 1 moves the key in the current database to a different database, this is the Confire key from the current database to move to 1

Persist confirm remove the expiration time of this key confirm

Randomkey randomly returns a key inside the database

Rename Key2 key3 rename Key2 to Key3

Type Key2 returns the data type of key

2. Server-related commands

Ping pong Returns whether the response was successfully connected

Echo Prints some content on the command line

Select 0~15 Number of databases

Quit/exit exiting the Client

Dbsize returns the number of all keys in the current database

Info returns information about Redis

Config get dir/* real-time upload of received requests

FLUSHDB Delete all keys in the currently selected database

Flushall Delete a database from all databases

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: info-contact@alibabacloud.com 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.