当前位置: 首页 > news >正文

redis-cli help使用

1. redis-cli命令使用—先连接上服务器

  1. 连接到 Redis 服务器: 使用 redis-cli 命令即可连接到本地运行的 Redis 服务器,默认连接到本地的 6379 端口。
redis-cli

如果 Redis 服务器不在本地或者端口不同,可以使用 -h 和 -p 参数指定主机和端口:

redis-cli -h <hostname> -p <port>
  1. 执行 Redis 命令: 连接成功后,可以直接在命令行中输入各种 Redis 命令来执行对应的操作,比如设置键值对、获取值、操作列表、集合等等。
  2. 交互式模式: 在命令行中输入 redis-cli 后,进入交互式模式,可以一次次地输入命令并查看结果,非常方便进行实时的交互操作。
  3. 执行脚本文件: 可以通过 --eval 参数执行 Lua 脚本文件,例如:
redis-cli --eval script.lua
  1. 其他参数: redis-cli 支持许多其他参数,可以使用 redis-cli --help 查看帮助文档,了解更多用法和选项

2. redis-cli连接到服务器后,可以使用help查看命令

img

根据输出可以看到

help 命令有三种用法

  1. “help @” to get a list of commands in ,
  2. ”help ” for help on ,
  3. ”help ” to get a list of possible help topics

2.1. help

help 之后按 tab 按键可提示参数。在命令行下 tab 按键相信是用的最多的一个按键。

help 空格之后一直按 tab, 可按顺序查看到所有可能的组和命令。也可输入需要查询的 @组或命令的前缀再按 tab 补全。

如:

help @generic 查看通用组的命令包括 del,dump… 等等通用命令。 help @string 查看字符串组命令。还可以查看其他组的命令如

help @list, help @set, help @sorted_set,help @hash 等等,查看所有的分组可以通过 help 提示(即help+空格后,按tab键)

2.2. help @ 查看具体命令组的帮助

img

APPEND key value
summary: Appends a string to the value of a key. Creates the key if it doesn't exist.
since: 2.0.0DECR key
summary: Decrements the integer value of a key by one. Uses 0 as initial value if the key doesn't exist.
since: 1.0.0DECRBY key decrement
summary: Decrements a number from the integer value of a key. Uses 0 as initial value if the key doesn't exist.
since: 1.0.0GET key
summary: Returns the string value of a key.
since: 1.0.0GETDEL key
summary: Returns the string value of a key after deleting the key.
since: 6.2.0GETEX key [EX seconds|PX milliseconds|EXAT unix-time-seconds|PXAT unix-time-milliseconds|PERSIST]
summary: Returns the string value of a key after setting its expiration time.
since: 6.2.0GETRANGE key start end
summary: Returns a substring of the string stored at a key.
since: 2.4.0GETSET key value
summary: Returns the previous string value of a key after setting it to a new value.
since: 1.0.0INCR key
summary: Increments the integer value of a key by one. Uses 0 as initial value if the key doesn't exist.
since: 1.0.0INCRBY key increment
summary: Increments the integer value of a key by a number. Uses 0 as initial value if the key doesn't exist.
since: 1.0.0INCRBYFLOAT key increment
summary: Increment the floating point value of a key by a number. Uses 0 as initial value if the key doesn't exist.
since: 2.6.0LCS key1 key2 [LEN] [IDX] [MINMATCHLEN min-match-len] [WITHMATCHLEN]
summary: Finds the longest common substring.
since: 7.0.0MGET key [key ...]
summary: Atomically returns the string values of one or more keys.
since: 1.0.0MSET key value [key value ...]
summary: Atomically creates or modifies the string values of one or more keys.
since: 1.0.1MSETNX key value [key value ...]
summary: Atomically modifies the string values of one or more keys only when all keys don't exist.
since: 1.0.1PSETEX key milliseconds value
summary: Sets both string value and expiration time in milliseconds of a key. The key is created if it doesn't exist.
since: 2.6.0SET key value [NX|XX] [GET] [EX seconds|PX milliseconds|EXAT unix-time-seconds|PXAT unix-time-milliseconds|KEEPTTL]
summary: Sets the string value of a key, ignoring its type. The key is created if it doesn't exist.
since: 1.0.0SETEX key seconds value
summary: Sets the string value and expiration time of a key. Creates the key if it doesn't exist.
since: 2.0.0SETNX key value
summary: Set the string value of a key only when the key doesn't exist.
since: 1.0.0SETRANGE key offset value
summary: Overwrites a part of a string value with another by an offset. Creates the key if it doesn't exist.
since: 2.2.0STRLEN key
summary: Returns the length of a string value.
since: 2.2.0SUBSTR key start end
summary: Returns a substring from a string value.
since: 1.0.0

2.3. help 查看具体命令的用法

help 具体命令可以查看命令的用法描述,命令从那个版本开始,命令属于哪个组等信息。如 help APPEND,

img

相关文章:

redis-cli help使用

1. redis-cli命令使用—先连接上服务器 连接到 Redis 服务器&#xff1a; 使用 redis-cli 命令即可连接到本地运行的 Redis 服务器&#xff0c;默认连接到本地的 6379 端口。 redis-cli如果 Redis 服务器不在本地或者端口不同&#xff0c;可以使用 -h 和 -p 参数指定主机和端…...

中华活页文选高中版投稿发表

《中华活页文选&#xff08;高中版&#xff09;》创刊于1960年&#xff0c;是中宣部所属中国出版传媒股份有限公司主管、中华书局主办的国家级基础教育期刊&#xff0c;曾获得“中国期刊方阵双效期刊”、国家新闻出版广电总局推荐的“百种优秀报刊”等荣誉称号。本刊以高中学科…...

[图解]企业应用架构模式2024新译本讲解02-表数据入口

1 00:00:00,420 --> 00:00:04,330 这个案例&#xff0c;我们就是用书上的案例了 2 00:00:06,080 --> 00:00:08,860 收入确认的一个案例 3 00:00:09,510 --> 00:00:11,100 书上讲了&#xff0c;收入确认 4 00:00:13,330 --> 00:00:15,270 就是说&#xff0c;你给…...

SSE(Server Sent Event) 踩坑留念

整条链路是 客户端A --> 服务端 A —> 服务端 B 我负责服务端 A 此时要注意 Client 中的 processes 的写法 Post(value “/v2/xx”, processes MediaType.TEXT_EVENT_STREAM) 这样写是一直报错的 改成下面的写法才可以 Post(value “/v2/xx”, processes MediaT…...

plt.xticks()的作用

参考&#xff1a; https://blog.csdn.net/weixin_41796265/article/details/131442400 plt.xticks() 是 Matplotlib 库中的一个函数&#xff0c;用于设置坐标轴刻度的位置和标签。 它的作用包括&#xff1a; 设置 x 轴刻度的位置&#xff1a;可以通过传递一个数组或列表来设…...

开发者的福音:免去搭建服务,让你的应用开发变得像吃蛋糕一样简单!

传统应用开发的"噩梦" 想象一下&#xff0c;你正在准备一场盛大的晚宴&#xff0c;但必须从零开始建造厨房、种植食材、甚至学习烹饪技巧。这就是传统应用开发的现状——你不仅要设计数据库、编写API接口&#xff0c;还要处理对象存储、实时数据库、云数据库等一系列…...

AVL树的模拟实现

我们上期提到了二叉搜索树&#xff0c;只是简单的讲了一下原理&#xff0c;那么今天我们就讲一下AVL树。 目录 AVL树的概念AVL树的实现AVL树的架构insert插入引用pair对象引进parent指针仅插入数据调节平衡因子情况1&#xff1a;插入在父亲的右边&#xff0c;父亲的平衡因子后…...

php 一个数组中的元素是否在一个字符串中包含

php 一个数组中的元素是否在一个字符串中包含 要检查一个数组中的元素是否在一个字符串中出现&#xff0c;你可以使用strpos()函数。这个函数返回子字符串首次出现的位置索引&#xff0c;如果没有找到&#xff0c;它会返回false。 $array [apple, banana, cherry]; $string …...

conda修改环境名称后,无法安装包,显示no such file

1问题描述 原本创建环境时设置的名字不太合适&#xff0c;但是因为重新创建环境很麻烦&#xff0c;安装很多包。。所以想直接对包名进行修改&#xff0c;本人采用的方式是直接找到conda环境的文件目录&#xff0c;然后修改文件名&#xff0c;简单粗暴。确实修改成功了&#xf…...

linux安装mysql【linux】

linux安装mysql【linux】 前言版权推荐CentOS7.9安装mysql8.0【linux】yum安装rpm安装 最后 前言 2024-5-13 15:52:22 以下内容源自《【linux】》 仅供学习交流使用 版权 禁止其他平台发布时删除以下此话 本文首次发布于CSDN平台 作者是CSDN日星月云 博客主页是https://jss…...

C 语言实例 - 表格形式输出数据

将 1~100 的数据以 10x10 矩阵格式输出。 #include <stdio.h>int main() {int i, j, count;for(i 1; i < 10; i) {for(j i; j <100; j 10 )printf(" %3d", j);printf("\n");}return 0; }运行结果&#xff1a; 1 11 21 31 41 51 61 …...

markdown语法保存

这里写自定义目录标题 欢迎使用Markdown编辑器新的改变功能快捷键合理的创建标题&#xff0c;有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants 创建一个自定义列表如何创建一个…...

数据结构(八)二叉树、哈希查找

文章目录 一、树&#xff08;一&#xff09;概念1. 前序遍历&#xff1a;根左右2. 中序遍历&#xff1a;左根右3. 后序遍历&#xff1a;左右根4. 层序遍历&#xff1a;需要借助队列实现 &#xff08;二&#xff09;代码实现&#xff1a;二叉树1. 结构体定义2. 创建二叉树1. 注意…...

uniApp 创建Android.keystore证书IOS的证书

Android 证书 1、安装JRE环境 可从Oracle官方下载jre安装包&#xff1a;https://www.oracle.com/technetwork/java/javase/downloads/index.html 打开命令行&#xff08;cmd&#xff09;&#xff0c;输入以下命令&#xff1a; //切换工作目录到f:路径 D: //将jre命令添加到…...

怎么藏族翻译中文在线翻译?更好地了解藏族文化

怎么藏族翻译中文在线翻译&#xff1f;着全球化的发展&#xff0c;语言交流的重要性日益凸显。藏族&#xff0c;作为中国的一个古老而神秘的民族&#xff0c;其语言对于很多人来说充满了神秘感。然而&#xff0c;在今天的数字化时代&#xff0c;我们有了更多的工具来打破语言壁…...

模拟集成电路(5)----单级放大器(共栅级)

模拟集成电路(5)----单级放大器&#xff08;共栅级&#xff09; 有一些场合需要一些小的输入电阻&#xff08;电流放大器&#xff09; 大信号分析 − W h e n V i n ≥ V B − V T H ∙ M 1 i s o f f , V o u t V D D − F o r L o w e r V i n I d 1 2 μ n C o x W L ( V…...

学习笔记——数据通信基础——数据通信网络(网络工程师)

网络工程师 网络工程&#xff0c;就是围绕着网络进行的一系列的活动&#xff0c;包括∶网络规划、设计、实施、调试、排错等。网络工程设计的知识领域很宽广&#xff0c;其中路由和交换是计算机网络的基本。 网络工程师∶是在网络工程领域&#xff0c;掌握专业的网络技术&…...

将本地项目上传到 gitee 仓库

1、创建 gitee 仓库 到 gitee 官网&#xff0c;新建仓库 配置新建仓库 完成仓库的创建 项目上传到仓库 上传项目需要安装git git官方下载地址&#xff1a;git下载地址 安装完成&#xff0c;前往本地项目所在文件夹&#xff0c;右击选择 Git Bash Here 刚下载完成需要配置G…...

Django学习

1.pycharm社区版创建django PyCharm社区版如何创建Django项目并运行_pycharm社区版打开django-CSDN博客 2.Django TemplateDoesNotExist: rest_framework 当我们使用djangorestframework框架时&#xff0c;首先下载pip install djangorestframework 参考博文Django Templat…...

说唱程序员

Yo yo yo&#xff0c;这里是代码的战场&#xff0c;程序员的秀场&#xff0c; 键盘敲击声&#xff0c;是我们的节奏响亮。 夜深人静时&#xff0c;我们与Bug正面刚&#xff0c; 调试、优化&#xff0c;每一行代码都得刚强。 我们不懂数理化&#xff0c;只是喜欢瞎搞哈&#xf…...

058.最后一个单词的长度

题意 给你一个字符串 s&#xff0c;由若干单词组成&#xff0c;单词前后用一些空格字符隔开。返回字符串中 最后一个 单词的长度。 单词 是指仅由字母组成、不包含任何空格字符的最大子字符串。 难度 简单 示例 1&#xff1a; 输入&#xff1a;s "Hello World" 输…...

决策树模型-预测用户是否购买某母婴产品

1&#xff0c;场景描述 假设我们是京东的数据分析师&#xff0c;负责分析母婴产品的购买行为。我们想预测用户是否会购买一款新上线的母婴产品。为了进行预测&#xff0c;我们将利用用户的历史购买数据、浏览行为和其他特征&#xff0c;通过决策树模型进行分析&#xff0c;并提…...

工具使用-网络性能测试工具(iperf)-TCP 和 UDP 的吞吐量-包转发率参数的理解

时间戳&#xff1a;2024年5月26日15:18:39 iperf 和 netperf 都是最常用的网络性能测试工具&#xff0c;测试 TCP 和 UDP 的吞吐量。它们都以客户端和服务器通信的方式&#xff0c;测试一段时间内的平均吞吐量。 接下来&#xff0c;我们就以 iperf 为例&#xff0c;看一下 TC…...

什么是JS引擎

JS引擎&#xff08;JavaScript引擎&#xff09;是负责在浏览器或Node.js等环境中解析和执行JavaScript代码的软件组件。它是JavaScript运行时的核心&#xff0c;将JavaScript代码转换为机器语言&#xff0c;使其能够在计算机上执行。 不同的浏览器和运行环境使用不同的JS引擎。…...

前端手写文件上传;使用input实现文件拖动上传

使用input实现文件拖动上传 vue2代码&#xff1a; <template><div><div class"drop-area" dragenter"highlight" dragover"highlight" dragleave"unhighlight" drop"handleDrop"click"handleClick&quo…...

Flutter 中的 PhysicalModel 小部件:全面指南

Flutter 中的 PhysicalModel 小部件&#xff1a;全面指南 Flutter 的 PhysicalModel 小部件提供了一种简单而高效的方式来给应用添加物理效果&#xff0c;如阴影和层次感。它本质上是一个矩形的 Container&#xff0c;带有圆角边框和可选的阴影&#xff0c;能够模仿真实世界中…...

Flutter 中的 Center 小部件:全面指南

Flutter 中的 Center 小部件&#xff1a;全面指南 在Flutter的世界里&#xff0c;Center是一个简单而强大的布局小部件&#xff0c;它能够将子组件放置在父组件的中心位置。无论是水平中心、垂直中心&#xff0c;还是两者都居中&#xff0c;Center都能轻松实现。本文将详细介绍…...

windows 执行node报错 800A1391

在项目下执行node -v的时候&#xff0c;抛了这个错误&#xff0c;一开始没发现有啥问题 现在一看&#xff0c;这个报错里的node怎么是个文件... 出现这个问题&#xff0c;是因为项目下&#xff0c;有个同名的文件叫node.js&#xff0c;搞得windows一时不知道是想打开node.js文…...

无人机操作界面来了,起点就很高呀。

无人机操作界面设计需要考虑以下几个方面&#xff1a; 易用性&#xff1a;无人机操作界面应该简单直观&#xff0c;易于操作和理解。操作按钮和控键应该布局合理&#xff0c;易于触摸或点击。重要的操作功能应该易于找到和使用&#xff0c;避免用户迷失或困惑。实时反馈&#…...

Android 11 AudioPolicyService 启动流程

AudioPolicyService在init进程中启动&#xff0c;源码路径&#xff1a;frameworks/av/media/audioserver/audioserver.rc service audioserver /system/bin/audioserverclass coreuser audioserver# media gid needed for /dev/fm (radio) and for /data/misc/media (tee)grou…...