Skip to content

Instantly share code, notes, and snippets.

@sgtcortez
Last active August 31, 2022 12:12
Show Gist options
  • Save sgtcortez/4b13d7eb4905d4f3a4eacff7dca8a7b9 to your computer and use it in GitHub Desktop.
Save sgtcortez/4b13d7eb4905d4f3a4eacff7dca8a7b9 to your computer and use it in GitHub Desktop.
redis-cli useful commands
  • Commands to obtain memory usage by certain key prefix:
redis-cli --scan --pattern "KEY_PREFIX*" | awk '{ print $1 }' | xargs --max-args 1 redis-cli MEMORY USAGE | awk '{total=total + $1} END { print "Total of bytes:", total} '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment