Last active
May 14, 2023 21:20
-
-
Save boriska70/c82314ca05492354c20e7fdc24044a0e to your computer and use it in GitHub Desktop.
Redis client usage from shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##### 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