Learn redis-installation and basic commands

Source: Internet
Author: User
Tags set set install redis

Redis Installation

Linux under the Environment install Redis, I download here is 3.0.0 version (currently the latest 3.2.0).

wget http://download.redis.io/releases/redis-3.0.0.tar.gztar xzf redis-  3.0. 0. Tar . gz$ CD Redis-3.0. 0 make

So Redis is installed, and then you start Redis:

$ src/redis-server

To connect Redis with a client tool that comes with you, reopen a window, enter into the redis-3.0.0 directory, enter:

$ src/redis-cli

Seeing the message means the connection is successful.

Redis Operations Basic Commands
    • String

      Command: Set key value, get key values with get

       

    • Hash

      Command: Hmset key field value [Field1 value1 ...]

      A Redis hash stores a mapping between a string field and a string value, so it is used to represent the object.

       

    • List

      Command: Lpush key value [value ...] to queue one or more elements from the left side of the list

      Command: Rpush key value [value ...] to enqueue one or more elements from the right side of the list

       

    • Set Set (unordered)

      Command: Sadd key value [value ...]

       

    • Set set:sorted sets (ordered)

      Command: Zadd key score Member[member ...]

      One or more members added to the ordered set, or the score is updated if it already exists

       

    • To view Redis consumption memory size

      Command: Info

       

    • View all keys in Redis

      Command: Keys *

       

Learn redis-installation and basic 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.