skip to content
Alvin Lucillo

Get keys count

/ 1 min read

You can use wc to get the total number of keys based on the pattern.

 redis-cli --scan --pattern 'domain*'        
"domain1:key2"
"domain3:key4"
"domain2:key3"
 redis-cli --scan --pattern 'domain*' | wc -l 
3