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

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/18767.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/18767.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/18767.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

華為校招機試 - LRU模擬(20240515)

題目描述 LRU(Least Recently Used)緩存算法是一種常用于管理緩存的策略,其目標是保留最近使用過的數據,而淘汰最久未被使用的數據。 實現簡單的LRU緩存算法,支持查詢、插入、刪除操作。 最久未被使用定義:查詢、插入和刪除操作均為一次訪問操作,每個元素均有一個最后…

探索Django 5: 從零開始,打造你的第一個Web應用

今天我們將一起探索 Django 5&#xff0c;一個備受開發者喜愛的 Python Web 框架。我們會了解 Django 5 的簡介&#xff0c;新特性&#xff0c;如何安裝 Django&#xff0c;以及用 Django 編寫一個簡單的 “Hello, World” 網站。最后&#xff0c;我會推薦一本與 Django 5 相關…

蘇洵,大器晚成的家風塑造者

&#x1f4a1; 如果想閱讀最新的文章&#xff0c;或者有技術問題需要交流和溝通&#xff0c;可搜索并關注微信公眾號“希望睿智”。 蘇洵&#xff0c;字明允&#xff0c;號老泉&#xff0c;生于宋真宗大中祥符二年&#xff08;公元1009年&#xff09;&#xff0c;卒于宋英宗治平…

量產導入 | 產品可靠性測試標準完整大集合(JEDEC/IEC/SAE…)

產品可靠性測試標準完整大集合(JEDEC/IEC/SAE…) 產品可靠性測試是產品質量保證中的重要一環, 包含有Pre-con, aging(壽命)和ESD(靜電)等, 下面就收集了權威標準JEDEC全系列, 請參照如下 同時也附上其它的可靠性標準供大家參考及交叉理解, 可能側重點不同, 大家可以參…

go語言同一包中的同一變量實現不同平臺設置不同的默認值 //go:build 編譯語法使用示例

在使用go來開發跨平臺應用的時候&#xff0c;比如配置文件的路徑&#xff0c;我們希望設置一個默認值&#xff0c;windows下的路徑是類似 d:\myapp\app.conf 這樣的&#xff0c; unix系統中的路徑是 /opt/myapp/app.conf 這樣的&#xff0c; 而我們在使用的時候需要使用的是同…

PPT忘記保存?教你如何輕松恢復

在日常辦公中PPT文件作為主流文檔格式&#xff0c;承載著我們大量的工作成果。然而當不小心誤點了“不保存”按鈕&#xff0c;或是遭遇軟件崩潰等意外情況導致文檔丟失時&#xff0c;文件內容是否還能夠能恢復&#xff0c;往往成為我們最關心的問題。本文將為您提供五大免費且實…

NetCore PetaPoco 事務處理分享

PetaPoco是一個輕量級的.NET和Mono數據庫訪問庫&#xff0c;它以單個C#文件的形式存在&#xff0c;便于集成到任何項目中。PetaPoco的主要特點包括無依賴性、快速的性能和對簡單事務的支持。它適用于嚴格的沒有裝飾的Poco類以及幾乎全部加了特性的Poco類&#xff0c;并提供了多…

現在版本的ultralytics沒有setup.py以后,本地代碼中修改了ultralytics源碼,怎么安裝到python環境中。

問題&#xff0c;在使用ultralytics訓練yolov8-obb模型時&#xff0c;修改了ultralytics源碼的網絡結構&#xff0c;發現調用的還是pip install安裝的ultralytics庫&#xff0c;新版本源碼中還沒有setup.py&#xff0c;該怎么把源碼中的ultralytics安裝到環境中。 解決方法&am…

《探索網絡七層模型:構建高效通信架構的關鍵》

在當今數字化時代&#xff0c;網絡通信已經成為人們生活和工作中不可或缺的一部分。而網絡七層模型作為計算機網絡體系結構的重要基礎&#xff0c;其技術架構對于構建高效、穩定的通信系統具有重要意義。本文將深入探討網絡七層模型的技術架構設計&#xff0c;以及其在構建現代…

輕松掌握圖片批量處理,趕緊學習這些小技巧!

在現今數字化的社會中&#xff0c;我們每天都會接觸到大量的圖片&#xff0c;無論是在工作中還是日常生活中。要想高效處理這些圖片&#xff0c;掌握圖片批量處理的技巧就顯得尤為重要。幸運的是&#xff0c;有許多小技巧和工具可以讓這一過程變得輕松愉快。 在本文中&#xf…

長安鏈使用Golang編寫智能合約教程(三)

本篇主要介紹長安鏈Go SDK寫智能合約的一些常見方法的使用方法或介紹 資料來源&#xff1a; 官方文檔官方示例合約庫官方SDK接口文檔 一、獲取參數、獲取狀態、獲取歷史記錄的方法解析 注意&#xff01; 這些查詢鏈上數據的方法&#xff1a;只能是查詢本合約之前上鏈的數據&a…

信息學一周賽事安排

本周比賽提醒 本周有以下幾場比賽即將開始&#xff1a; 1.ABC-356 比賽時間&#xff1a;6月1日&#xff08;周六&#xff09;晚20:00 比賽鏈接&#xff1a;https://atcoder.jp/contests/abc356 2.ARC-179 比賽時間&#xff1a;6月2日&#xff08;周日&#xff09;晚20:00 …

【Go】十、路由配置以及ZAP 高性能日志庫的使用

Project 目錄創建 mxshop-api user-web api ---- 服務接口 config ---- 配置信息 forms ---- 表單驗證信息 global ---- 全局信息 initialize ---- 初始化信息 middlewares ---- 中間件信息 proto ---- 數據信息 router ---- 路由信息 utils ---- 公用工具信息 validator ----…

excel導到access后長文本內容缺失

參考該文Excel表格如何導入Access數據庫以及列內容超過255個字符被截斷解決辦法 - 知乎 原因是access數據中列內容超過255個字符會被截斷。 解決方法&#xff1a;將該字段的數據類型修改為長文本即可。

微調真的能讓LLM學到新東西嗎:引入新知識可能讓模型產生更多的幻覺

大型語言模型(llm)是在巨大的文本語料庫上訓練的&#xff0c;在那里他們獲得了大量的事實知識。這些知識嵌入到它們的參數中&#xff0c;然后可以在需要時使用。這些模型的知識在培訓結束時被“具體化”。在預訓練結束時&#xff0c;模型實際上停止學習。 對模型進行對齊或進行…

【VTKExamples::Utilities】第十四期 Screenshot

很高興在雪易的CSDN遇見你 VTK技術愛好者 QQ:870202403 公眾號:VTK忠粉 前言 本文分享VTK樣例Screenshot,保存窗口快照,并解析接口vtkWindowToImageFilter,希望對各位小伙伴有所幫助! 感謝各位小伙伴的點贊+關注,小易會繼續努力分享,一起進步! 你的點贊就是…

SELINUX=enforcing時無法啟動httpd服務的解決方案(semanage命令以及setroubleshoot-server插件的妙用)

一、問題描述&#xff1a; 當/etc/selinux/conf被要求必須是SELINUXenforcing&#xff0c;不被允許使用setenforce 0寬松模式 我們啟動httpd就會報錯&#xff1a; Job for httpd.service failed because the control process exited with error code. See "systemctl s…

如何安裝ansible

ansible安裝 1、 準備環境----關閉防護墻和selinux 一般用ansible不會少于10臺以上 環境: 主機&#xff1a;4臺 一個控制節點 3個被控制節點 解析&#xff1a;本地互相解析(所有機器) # vim /etc/hosts 192.168.1.10 ansible-web1 192.168.1.11 ansible-web2 192.168.1.12…

重生之 SpringBoot3 入門保姆級學習(08、properties 和 yml 表示復雜對象)

重生之 SpringBoot3 入門保姆級學習&#xff08;08、properties 和 yml 表示復雜對象&#xff09; 2.5 yml 配置文件2.6 復雜對象用 properties 表示2.7 復雜對象用 yml 表示 2.5 yml 配置文件 application.properties 配置文件書寫形式 server.port9999spring.data.redis.hos…

Let‘s Encrypt 免費證書申請

填寫郵箱&#xff0c;申請的域名 單域名&#xff1a;www.example.com 泛域名&#xff1a; *.example.com yum -y install certbot sudo certbot certonly --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns --email xxexample…