redis-cli命令

redis-cli 3.2.3

Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]]]
  -h <hostname>      Server hostname (default: 127.0.0.1).
  -p <port>          Server port (default: 6379).
  -s <socket>        Server socket (overrides hostname and port).
  -a <password>      Password to use when connecting to the server.
  -r <repeat>        Execute specified command N times.
  -i <interval>      When -r is used, waits <interval> seconds per command.
                     It is possible to specify sub-second times like -i 0.1.
  -n <db>            Database number.
  -x                 Read last argument from STDIN.
  -d <delimiter>     Multi-bulk delimiter in for raw formatting (default: \n).
  -c                 Enable cluster mode (follow -ASK and -MOVED redirections).
  --raw              Use raw formatting for replies (default when STDOUT is
                     not a tty).
  --no-raw           Force formatted output even when STDOUT is not a tty.
  --csv              Output in CSV format.
  --stat             Print rolling stats about server: mem, clients, ...
  --latency          Enter a special mode continuously sampling latency.
  --latency-history  Like --latency but tracking latency changes over time.
                     Default time interval is 15 sec. Change it using -i.
  --latency-dist     Shows latency as a spectrum, requires xterm 256 colors.
                     Default time interval is 1 sec. Change it using -i.
  --lru-test <keys>  Simulate a cache workload with an 80-20 distribution.
  --slave            Simulate a slave showing commands received from the master.
  --rdb <filename>   Transfer an RDB dump from remote server to local file.
  --pipe             Transfer raw Redis protocol from stdin to server.
  --pipe-timeout <n> In --pipe mode, abort with error if after sending all data.
                     no reply is received within <n> seconds.
                     Default timeout: 30. Use 0 to wait forever.
  --bigkeys          Sample Redis keys looking for big keys.
  --scan             List all keys using the SCAN command.
  --pattern <pat>    Useful with --scan to specify a SCAN pattern.
  --intrinsic-latency <sec> Run a test to measure intrinsic system latency.
                     The test will run for the specified amount of seconds.
  --eval <file>      Send an EVAL command using the Lua script at <file>.
  --ldb              Used with --eval enable the Redis Lua debugger.
  --ldb-sync-mode    Like --ldb but uses the synchronous Lua debugger, in
                     this mode the server is blocked and script changes are
                     are not rolled back from the server memory.
  --help             Output this help and exit.
  --version          Output version and exit.

Examples:
  cat /etc/passwd | redis-cli -x set mypasswd
  redis-cli get mypasswd
  redis-cli -r 100 lpush mylist x
  redis-cli -r 100 -i 1 info | grep used_memory_human:
  redis-cli --eval myscript.lua key1 key2 , arg1 arg2 arg3
  redis-cli --scan --pattern ‘*:12345*‘

  (Note: when using --eval the comma separates KEYS[] from ARGV[] items)

When no command is given, redis-cli starts in interactive mode.
Type "help" in interactive mode for information on available commands
and settings.
时间: 2024-08-10 23:30:04

redis-cli命令的相关文章

Redis学习笔记之五:redis keys命令 (24个)

Redis 版本:3.2.100 Redis 命令 Redis 命令用于在 redis 服务上执行操作. 要在 redis 服务上执行命令需要一个 redis 客户端. 一.客户端连接服务器 基本语法: redis-cli [-h host -p port -a password] 不带参数,则默认连接本地,带上三个参数,则连接远程服务器. 举例: 如何连接到主机为 127.0.0.1,端口为 6379 ,密码为 mypass 的 redis 服务上. redis-cli -h 127.0.0.

2. Redis 常用命令

注意:Redis中命令不区分大小写 Set命令 set bar 1 #设置一个key 为bar的键 get命令 get bar #获取bar键的键值 keys keys * #获取所有的键 exists exists [key] #判定是否存在key,如果存在返回1,后在返回0 del del key [key-] #可以删除一个或多个键,返回值是删除的键的个数 type 获取键值的类型 返回的类型可以是:string:hash:list:set:zset incr 1) 当时整数类型时,会自增

我的关于Veritas Volume Manager的常用CLI命令总结

Veritas VM作为一个高端系统级的磁盘/存储阵列解决方案,功能强大,命令很多.本文将个人在维护过程中常用的一些CLI命令进行总结罗列,以方便使用. 参考资料: VERITAS Volume Manager Command Line Interface Administrator's Guide Veritas Volume Manager快速入门经典教程 常用命令: #Vxdisk管理字符驱动工具 vxdiskadm #查看存在的卷管理对象信息 vxprint [-g <diskgroup

[Redis] redis-cli 命令总结

Redis提供了丰富的命令(command)对数据库和各种数据类型进行操作,这些command可以在Linux终端使用.在编程时,比如使用Redis 的Java语言包,这些命令都有对应的方法.下面将Redis提供的命令做一总结. 官网命令列表:http://redis.io/commands (英文) 1.连接操作相关的命令 quit:关闭连接(connection) auth:简单密码认证 2.对value操作的命令 exists(key):确认一个key是否存在 del(key):删除一个k

Redis server命令

欢迎大家加入 459479177QQ群进行交流 本章介绍Redis sever 1.sync,类似MySQL的replication 127.0.0.1:6379> sync Entering slave output mode...  (press Ctrl-C to quit) SYNC with master, discarding 601 bytes of bulk transfer... SYNC done. Logging commands from master. "PING

redis info 命令详解

详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcyt119 Redis Info 命令以一种易于理解和阅读的格式,返回关于 Redis 服务器的各种信息和统计数值. 通过给定可选的参数 section ,可以让命令只返回某一部分的信息: server : 一般 Redis 服务器信息,包含以下域: redis_version : Redis 服务器版本 redis_git_sha1 : Git SHA1 redis_git_d

windows下自动启动Redis隐藏命令行窗口

这段时间看了看关于Redis的相关内容,对于Redis在windows下的安装和常规启动我就不多说了.可以参考其他的博客http://www.cnblogs.com/edisonchou/p/3821228.html.我按照这篇博客的方法添加启动Redis的windows服务,但是在启动服务的时候,会报错:错误1053:服务没有及时响应启动或控制请求.如下图: 我查了相关资料,有的人说是因为windows8系统权限问题.我就想能不能绕过这个错误,实现自动启动Redis,而不用再命令行中启动. 一

CLI命令模式下Call to undefined function mysql_connect()

背景: http访问一切正常,可以connect到数据库存取数据.但是当CLI模式时会出现Call to undefined function mysql_connect() 原因:CLI模式下 没有配置php.ini文件,或者配置了php.ini,但是php.ini里没有php_mysql.dll或mysql.so模块 解决: 1 首先执行 php -m检查 mysql模块是否加载 2 执行命令 php --ini 检查命令模式的配置文件路径以及配置文件是否存在 输出如下: Configura

自学总结redis第二部分(redis常用命令、高级命令特性以及与java代码的结合)

六.redis多数据类型介绍(常用命令) 6.1前提操作 #如果前面的redis环境没搭好,那么可以先暂时在 "http://try.redis.io/"中实践redis命令部分.   #为了测试方便,把redis登录密码暂时撤销   #redis一共分为五种基本数据类型:String,Hash,List,Set,ZSet #所有命令都可以到"http://www.redis.cn/commands.html"  去搜索到. #首先由于redis是一个基于key-v

Redis Ltrim 命令

Redis Ltrim 对一个列表进行修剪(trim),就是说,让列表只保留指定区间内的元素,不在指定区间之内的元素都将被删除. 下标 0 表示列表的第一个元素,以 1 表示列表的第二个元素,以此类推. 你也可以使用负数下标,以 -1 表示列表的最后一个元素, -2 表示列表的倒数第二个元素,以此类推. 语法 redis Ltrim 命令基本语法如下: redis 127.0.0.1:6379> LTRIM KEY_NAME START STOP 可用版本 >= 1.0.0 返回值 命令执行成