Redis Common Commands

Source: Internet
Author: User
Tags echo name

Start Redis Service
Src/redis-server or Src/redis-server redis.conf

Src/redis-server redis.conf 1>log.log 2>errlog.log

1 is the standard output and 2 is the error output

Randomly start Redis as a Linux service
Vi/etc/rc.local, add code:

/root/install/redis-2.4.9/src/redis-server

Client connections
Src/redis-cli

To stop the Redis service:
SRC/REDIS-CLI shutdown

Additions and deletions to check:

Keys *
Remove all keys that are currently matched

> Exists Larry
(integer) 0

Whether the current key exists

Del LV
Delete current key

Expire
Set Expiration Time

> Expire Larry 10
(integer) 1

> Move Larry Ad4
(integer) 1

Move Larry Key value pair to AD4 database

> Persist LV
(integer) 1
Remove the expiration time of the current key

Randomkey

Randomly returns a key

Rename
Rename Key

Type
The data type of the return value

Type testlist
List


> Ping
PONG

Test whether the connection is still

>echo Name

"Larry"

Print

> Select Ad4databank
Ok
Database switchover

> Quit
Exit connection

> dbsize
(integer) 12

Number of keys in the current database

> Info
Server basic Information

Monitor

Real-time dumping of received requests

Config get
Get the parameter configuration of the server

Flushdb
Empty the current database

Flushall
Clear all databases


Redis Common Commands

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.