everything: I want to work redis in my shell, my lockout is redis ip: 127.0.0.1 port: 6379, I want to insert data into redis in my shell, but I don’t know how to work redis in my own shell, is there any redis command , such as mysql -e, execute directly in the shell.
Just use echowith redis-clias follows:
echo
redis-cli
# Delete list of cores echo DEL cores | redis-cli # Add a new core to the list of cores echo LPUSH cores 1 | redis-cli # Wait forever for a core to become available echo BLPOP cores 0 | redis-cli
It’s less easy to access commands without pipelines:
> redis-cli -n 0 LPUSH mylist "hello" (integer) 1
, -n, mysql use <database>, ( ). cli redis . , :
-n
use <database>
> INFO keyspace db0:keys=4,expires=0,avg_ttl=0
: https://redis.io/topics/rediscli