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
( article from: http://blog.csdn.net/rockstar541/article/details/30245493)
Redis Common Commands