Skip to content

Instantly share code, notes, and snippets.

@boriska70
Last active May 14, 2023 21:20
Show Gist options
  • Save boriska70/c82314ca05492354c20e7fdc24044a0e to your computer and use it in GitHub Desktop.
Save boriska70/c82314ca05492354c20e7fdc24044a0e to your computer and use it in GitHub Desktop.
Redis client usage from shell
##### Get values by pattern and group by
export keys=""
for key in $(redis-cli -h hostname.com keys "pat:tern:*"); do
keys="$keys"" ""$key"
done
redis-cli -h hostname.com mget $(echo $keys) > values_1405
cat values_1405 | sort | uniq -c
echo $keys | tr " " "\n" | wc -l
echo $keys | tr " " "\n" > keys_1405
paste keys_1405 values_1405 > result_1405
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment