{"id":618,"date":"2016-06-20T15:23:29","date_gmt":"2016-06-20T09:53:29","guid":{"rendered":"https:\/\/blog.pheonixsolutions.com\/?p=618"},"modified":"2016-06-20T15:23:29","modified_gmt":"2016-06-20T09:53:29","slug":"redis-common-commands","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/","title":{"rendered":"Redis Common Commands"},"content":{"rendered":"<p>First thing to know is that you can use &#8220;telnet&#8221; (usually on default port 6397)<\/p>\n<pre>telnet localhost 6397<\/pre>\n<p>or the Redis CLI client<\/p>\n<pre>redis-cli<\/pre>\n<p>to connect to Redis. The advantage of redis-cli is that you have a help interface and command line history.<\/p>\n<p>CLI Queries<\/p>\n<p>Here is a short list of some basic data extraction commands:<\/p>\n<table>\n<tbody>\n<tr>\n<th>Type<\/th>\n<th>Syntax and Explanation<\/th>\n<\/tr>\n<tr>\n<td>Tracing<\/td>\n<td>Watch current live commands. Use this with care on production. Cancel with Ctrl-C.<\/p>\n<pre>monitor<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td>Slow Queries<\/td>\n<td>\n<pre>slowlog get 25\t\t# print top 25 slow queries\r\nslowlog len\t\t\r\nslowlog reset\r\n<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td>Search Keys<\/td>\n<td>\n<pre>keys pattern\t\t# Find key matching exactly\r\nkeys pattern*\t\t# Find keys matching in back\r\nkeys *pattern*\t\t# Find keys matching somewhere\r\nkeys pattern*\t\t# Find keys matching in front\r\n<\/pre>\n<p><b><span style=\"text-decoration: underline;\"> On production servers use &#8220;KEYS&#8221; with care as it causes a full scan of all keys! <\/span><\/b><\/td>\n<\/tr>\n<tr>\n<td>Generic<\/td>\n<td>\n<pre>del &lt;key&gt;\r\ndump &lt;key&gt;\t\t# Serialize key\r\nexists &lt;key&gt;\r\nexpire &lt;key&gt; &lt;seconds&gt;\r\n<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td>Scalars<\/td>\n<td>\n<pre>get &lt;key&gt;\t\r\nset &lt;key&gt; &lt;value&gt;\r\nsetnx &lt;key&gt; &lt;value&gt;\t# Set key value only if key does not exist\r\n<\/pre>\n<p>Batch commands:<\/p>\n<pre>mget &lt;key&gt; &lt;key&gt; ...\r\nmset &lt;key&gt; &lt;value&gt; &lt;key&gt; &lt;value&gt; ...\r\n<\/pre>\n<p>Counter commands:<\/p>\n<pre>incr &lt;key&gt;\r\ndecr &lt;key&gt;\r\n<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td>Lists<\/td>\n<td>\n<pre>lrange &lt;key&gt; &lt;start&gt; &lt;stop&gt;\r\nlrange mylist 0 -1\t\t# Get all of a list\r\nlindex mylist 5\t\t\t# Get by index\r\nllen mylist\t\t\t# Get length\r\n\r\nlpush mylist \"value\"\r\nlpush mylist 5\t\t\t\r\nrpush mylist \"value\"\r\n\r\nlpushx mylist 6\t\t\t# Only push in mylist exists\r\nrpushx mylist 0 \r\n\r\nlpop mylist\r\nrpop mylist\r\n\r\nlrem mylist 1 \"value\"\t\t# Remove 'value' count times\r\nlset mylist 2 6\t\t\t# mylist[2] = 6\r\nltrim &lt;key&gt; &lt;start&gt; &lt;stop&gt;\r\n<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td>Hashes<\/td>\n<td>\n<pre>hexists myhash field1\t\t# Check if hash key exists\r\n\r\nhget myhash field1\r\nhdel myhash field2\r\nhset myhash field1 \"value\"\r\nhsetnx myhash field1 \"value\"\r\n\r\nhgetall myhash\r\nhkeys myhash\r\nhlen myhash\r\n<\/pre>\n<p>Batch commands:<\/p>\n<pre>hmget &lt;key&gt; &lt;key&gt; ...\r\nhmset &lt;key&gt; &lt;value&gt; &lt;key&gt; &lt;value&gt; ...\r\n<\/pre>\n<p>Counter commands<\/p>\n<pre>hincrby myhash field1 1\r\nhincrby myhash field1 5\r\nhincrby myhash field1 -1\r\n\r\nhincrbrfloat myhash field2 1.123445 \r\n<\/pre>\n<\/td>\n<\/tr>\n<tr>\n<td>Sets<\/td>\n<td>FIXME<\/td>\n<\/tr>\n<tr>\n<td>Sorted Sets<\/td>\n<td>FIXME<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Cli Scripting<\/h4>\n<p>For scripting just pass commands to &#8220;redis-cli&#8221;. For example:<\/p>\n<pre>$ redis-cli INFO | grep connected\r\nconnected_clients:2\r\nconnected_slaves:0\r\n$<\/pre>\n<h4><\/h4>\n<h4>Server Statistics<\/h4>\n<p>The statistics command is &#8220;INFO&#8221; and will give you an output as following.<\/p>\n<pre>$ redis-cli INFO\r\nredis_version:2.2.12\r\nredis_git_sha1:00000000\r\nredis_git_dirty:0\r\narch_bits:64\r\nmultiplexing_api:epoll\r\nprocess_id:8353\r\nuptime_in_seconds:2592232\r\nuptime_in_days:30\r\nlru_clock:809325\r\nused_cpu_sys:199.20\r\nused_cpu_user:309.26\r\nused_cpu_sys_children:12.04\r\nused_cpu_user_children:1.47\r\nconnected_clients:2\t\t\t# &lt;---- connection count\r\nconnected_slaves:0\r\nclient_longest_output_list:0\r\nclient_biggest_input_buf:0\r\nblocked_clients:0\r\nused_memory:6596112\r\nused_memory_human:6.29M\t\t\t# &lt;---- memory usage\r\nused_memory_rss:17571840\r\nmem_fragmentation_ratio:2.66\r\nuse_tcmalloc:0\r\nloading:0\r\naof_enabled:0\r\nchanges_since_last_save:0\r\nbgsave_in_progress:0\r\nlast_save_time:1371241671\r\nbgrewriteaof_in_progress:0\r\ntotal_connections_received:118\r\ntotal_commands_processed:1091\r\nexpired_keys:441\r\nevicted_keys:0\r\nkeyspace_hits:6\r\nkeyspace_misses:1070\r\nhash_max_zipmap_entries:512\r\nhash_max_zipmap_value:64\r\npubsub_channels:0\r\npubsub_patterns:0\r\nvm_enabled:0\r\nrole:master\t\t\t\t# &lt;---- master\/slave in replication setup\r\ndb0:keys=91,expires=88<\/pre>\n<h3><\/h3>\n<h3>Changing Runtime Configuration<\/h3>\n<p>The command<\/p>\n<pre>CONFIG GET *<\/pre>\n<p>gives you a list of all active configuration variables you can change. The output might look like this:<\/p>\n<pre>redis 127.0.0.1:6379&gt; CONFIG GET *\r\n 1) \"dir\"\r\n 2) \"\/var\/lib\/redis\"\r\n 3) \"dbfilename\"\r\n 4) \"dump.rdb\"\r\n 5) \"requirepass\"\r\n 6) (nil)\r\n 7) \"masterauth\"\r\n 8) (nil)\r\n 9) \"maxmemory\"\r\n10) \"0\"\r\n11) \"maxmemory-policy\"\r\n12) \"volatile-lru\"\r\n13) \"maxmemory-samples\"\r\n14) \"3\"\r\n15) \"timeout\"\r\n16) \"300\"\r\n17) \"appendonly\"\r\n18) \"no\"\r\n19) \"no-appendfsync-on-rewrite\"\r\n20) \"no\"\r\n21) \"appendfsync\"\r\n22) \"everysec\"\t\t\t\t# &lt;---- how often fsync() is called\r\n23) \"save\"\r\n24) \"900 1 300 10 60 10000\"\t\t# &lt;---- how often Redis dumps in background\r\n25) \"slave-serve-stale-data\"\r\n26) \"yes\"\r\n27) \"hash-max-zipmap-entries\"\r\n28) \"512\"\r\n29) \"hash-max-zipmap-value\"\r\n30) \"64\"\r\n31) \"list-max-ziplist-entries\"\r\n32) \"512\"\r\n33) \"list-max-ziplist-value\"\r\n34) \"64\"\r\n35) \"set-max-intset-entries\"\r\n36) \"512\"\r\n37) \"slowlog-log-slower-than\"\r\n38) \"10000\"\r\n39) \"slowlog-max-len\"\r\n40) \"64\"\r\n<\/pre>\n<p>Note that keys and values are alternating and you can change each key by issuing a &#8220;CONFIG SET&#8221; command like:<\/p>\n<pre>CONFIG SET timeout 900<\/pre>\n<p>Such a change will be effective instantly. When changing values consider also updating the redis configuration file.<\/p>\n<h3><\/h3>\n<h3>Databases<\/h3>\n<h4><a name=\"TOC-Multiple-Databases\"><\/a>Multiple Databases<\/h4>\n<p>Redis has a concept of separated namespaces called &#8220;databases&#8221;. You can select the database number you want to use with &#8220;SELECT&#8221;. By default the database with index 0 is used. So issuing<\/p>\n<pre>redis 127.0.0.1:6379&gt; SELECT 1\r\nOK\r\nredis 127.0.0.1:6379[1]&gt;<\/pre>\n<p>switches to the second database. Note how the prompt changed and now has a &#8220;[1]&#8221; to indicate the database selection. To find out how many databases there are you might want to run redis-cli from the shell:<\/p>\n<pre>$ redis-cli INFO | grep ^db\r\ndb0:keys=91,expires=88\r\ndb1:keys=1,expires=0\r\n<\/pre>\n<h4><a name=\"TOC-Dropping-Databases\"><\/a>Dropping Databases<\/h4>\n<p>To drop the currently selected database run<\/p>\n<pre>FLUSHDB<\/pre>\n<p>to drop all databases at once run<\/p>\n<pre>FLUSHALL<\/pre>\n<h3><\/h3>\n<h3>Replication<\/h3>\n<h4><a name=\"TOC-Checking-for-Replication\"><\/a>Checking for Replication<\/h4>\n<p>To see if the instance is a replication slave or master issue<\/p>\n<pre>redis 127.0.0.1:6379&gt; INFO\r\n[...]\r\nrole:master<\/pre>\n<p>and watch for the &#8220;role&#8221; line which shows either &#8220;master&#8221; or &#8220;slave&#8221;. Starting with version 2.8 the &#8220;INFO&#8221; command also gives you per slave replication status looking like this<\/p>\n<pre>slave0:ip=127.0.0.1,port=6380,state=online,offset=281,lag=0<\/pre>\n<h4><\/h4>\n<h4>Setting up Replication<\/h4>\n<p>If you quickly need to set up replication just issue<\/p>\n<pre>SLAVEOF &lt;IP&gt; &lt;port&gt;<\/pre>\n<p>on a machine that you want to become slave of the given IP. It will immediately get values from the master. Note that this instance will still be writable. If you want it to be read-only change the redis config file (only available in most recent version, e.g. not on Debian). To revert the slave setting run<\/p>\n<pre>SLAVEOF NO ONE<\/pre>\n<h3><a name=\"TOC-Debugging-Latency\"><\/a>Debugging Latency<\/h3>\n<p>First measure system latency on your Redis server with<\/p>\n<pre>redis-cli --intrinsic-latency 100<\/pre>\n<p>and then sample from your Redis clients with<\/p>\n<pre>redis-cli --latency -h &lt;host&gt; -p &lt;port&gt;<\/pre>\n<p>If you have problems with high latency check if transparent huge pages are disabled. Disable it with<\/p>\n<pre>echo never &gt; \/sys\/kernel\/mm\/transparent_hugepage\/enabled<\/pre>\n<h3><\/h3>\n<h3>Dump Database Backup<\/h3>\n<p>As Redis allows RDB database dumps in background, you can issue a dump at any time. Just run:<\/p>\n<pre>BGSAVE<\/pre>\n<p>When running this command Redis will fork and the new process will dump into the &#8220;dbfilename&#8221; configured in the Redis configuration without the original process being blocked. Of course the fork itself might cause an interruption. Use &#8220;LASTSAVE&#8221; to check when the dump file was last updated. For a simple backup solution just backup the dump file. If you need a synchronous save run &#8220;SAVE&#8221; instead of &#8220;BGSAVE&#8221;.<\/p>\n<h3><a name=\"TOC-Listing-Connections\"><\/a>Listing Connections<\/h3>\n<p>Starting with version 2.4 you can list connections with<\/p>\n<pre>CLIENT LIST<\/pre>\n<p>and you can terminate connections with<\/p>\n<pre>CLIENT KILL &lt;IP&gt;:&lt;port&gt;<\/pre>\n<h3><\/h3>\n<h3>Monitoring Traffic<\/h3>\n<p>The propably most useful command compared to memcached where you need to trace network traffic is the &#8220;MONITOR&#8221; command which will dump incoming commands in real time.<\/p>\n<pre>redis 127.0.0.1:6379&gt; MONITOR\r\nOK\r\n1371241093.375324 \"monitor\"\r\n1371241109.735725 \"keys\" \"*\"\r\n1371241152.344504 \"set\" \"testkey\" \"1\"\r\n1371241165.169184 \"get\" \"testkey\"\r\n<\/pre>\n<p>additionally use &#8220;SLOWLOG&#8221; to track the slowest queries in an interval. For example<\/p>\n<pre>SLOWLOG RESET\r\n# wait for some time\r\nSLOWLOG GET 25\r\n<\/pre>\n<p>and get the 25 slowest command during this time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First thing to know is that you can use &#8220;telnet&#8221; (usually on default port 6397) telnet localhost 6397 or the Redis CLI client redis-cli to connect to Redis. The advantage of redis-cli is that you have a help interface and command line history. CLI Queries Here is a short list&hellip; <a href=\"https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/\" class=\"more-link read-more\" rel=\"bookmark\">Continue Reading <span class=\"screen-reader-text\">Redis Common Commands<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":{"0":"post-618","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-uncategorized","7":"h-entry","9":"h-as-article"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Pheonix Solutions - We Empower Your Business Growth<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pheonix Solutions - We Empower Your Business Growth\" \/>\n<meta property=\"og:description\" content=\"First thing to know is that you can use &#8220;telnet&#8221; (usually on default port 6397) telnet localhost 6397 or the Redis CLI client redis-cli to connect to Redis. The advantage of redis-cli is that you have a help interface and command line history. CLI Queries Here is a short list&hellip; Continue Reading Redis Common Commands\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"PHEONIXSOLUTIONS\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-06-20T09:53:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/PX2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"3837\" \/>\n\t<meta property=\"og:image:height\" content=\"2540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pheonixsolution\" \/>\n<meta name=\"twitter:site\" content=\"@pheonixsolution\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/redis-common-commands\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/redis-common-commands\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/0ffa33d73c869faec2d50e79c24e3503\"},\"headline\":\"Redis Common Commands\",\"datePublished\":\"2016-06-20T09:53:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/redis-common-commands\\\/\"},\"wordCount\":587,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/redis-common-commands\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/redis-common-commands\\\/\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/redis-common-commands\\\/\",\"name\":\"Pheonix Solutions - We Empower Your Business Growth\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2016-06-20T09:53:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/redis-common-commands\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/redis-common-commands\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/redis-common-commands\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Redis Common Commands\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\",\"name\":\"Pheonix Solutions\",\"description\":\"We Empower Your Business Growth\",\"publisher\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\",\"name\":\"PheonixSolutions\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/12\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/12\\\/logo.png\",\"width\":454,\"height\":300,\"caption\":\"PheonixSolutions\"},\"image\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/PheonixSolutions-209942982759387\\\/\",\"https:\\\/\\\/x.com\\\/pheonixsolution\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/0ffa33d73c869faec2d50e79c24e3503\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"http:\\\/\\\/blog.pheonixsolutions.com\"],\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pheonix Solutions - We Empower Your Business Growth","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/","og_locale":"en_US","og_type":"article","og_title":"Pheonix Solutions - We Empower Your Business Growth","og_description":"First thing to know is that you can use &#8220;telnet&#8221; (usually on default port 6397) telnet localhost 6397 or the Redis CLI client redis-cli to connect to Redis. The advantage of redis-cli is that you have a help interface and command line history. CLI Queries Here is a short list&hellip; Continue Reading Redis Common Commands","og_url":"https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/","og_site_name":"PHEONIXSOLUTIONS","article_publisher":"https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/","article_published_time":"2016-06-20T09:53:29+00:00","og_image":[{"width":3837,"height":2540,"url":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/PX2.png","type":"image\/png"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@pheonixsolution","twitter_site":"@pheonixsolution","twitter_misc":{"Written by":"admin","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/#article","isPartOf":{"@id":"https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/"},"author":{"name":"admin","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/person\/0ffa33d73c869faec2d50e79c24e3503"},"headline":"Redis Common Commands","datePublished":"2016-06-20T09:53:29+00:00","mainEntityOfPage":{"@id":"https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/"},"wordCount":587,"commentCount":0,"publisher":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/","url":"https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/","name":"Pheonix Solutions - We Empower Your Business Growth","isPartOf":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#website"},"datePublished":"2016-06-20T09:53:29+00:00","breadcrumb":{"@id":"https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/pheonixsolutions.com\/blog\/redis-common-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/pheonixsolutions.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Redis Common Commands"}]},{"@type":"WebSite","@id":"https:\/\/pheonixsolutions.com\/blog\/#website","url":"https:\/\/pheonixsolutions.com\/blog\/","name":"Pheonix Solutions","description":"We Empower Your Business Growth","publisher":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pheonixsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/pheonixsolutions.com\/blog\/#organization","name":"PheonixSolutions","url":"https:\/\/pheonixsolutions.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/12\/logo.png","contentUrl":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/12\/logo.png","width":454,"height":300,"caption":"PheonixSolutions"},"image":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/","https:\/\/x.com\/pheonixsolution"]},{"@type":"Person","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/person\/0ffa33d73c869faec2d50e79c24e3503","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g","caption":"admin"},"sameAs":["http:\/\/blog.pheonixsolutions.com"],"url":"https:\/\/pheonixsolutions.com\/blog\/author\/admin\/"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7F4uM-9Y","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/618","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=618"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/618\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=618"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=618"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=618"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}