title: Err Unknown command scan, redis-cli
body: <p>Installed the redis on ubuntu using 
  <a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-redis-on-ubuntu-18-04" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-redis-on-ubuntu-18-04</a></p>
  
  <p>redis-server -v gives </p>
  
  <pre><code>Redis server v=4.0.9 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=76095d16786fbcba
  </code></pre>
  
  <p>redis-cli -v gives </p>
  
  <pre><code>redis-cli 4.0.9
  </code></pre>
  
  <p>While redis-cli info gives</p>
  
  <pre><code>redis_version:2.4.6
  redis_git_sha1:26cdd13a
  redis_git_dirty:0
  arch_bits:64
  multiplexing_api:winsock2
  gcc_version:4.6.1
  </code></pre>
  
  <p>When run the scan command <strong>redis-cli scan 0</strong> it gives error </p>
  
  <pre><code>(error) ERR unknown command 'scan'
  </code></pre>
  
  <p>Learned that scan only works on redis version 2.8+, so tried to update redis <strong>sudo apt install redis-server</strong> but it says </p>
  
  <pre><code>redis-server is already the newest version (5:4.0.9-1ubuntu0.1).
  </code></pre>
  
  <p>How can we run the SCAN command?</p>