Created
January 17, 2019 09:40
-
-
Save hugo53/24afc88e1e774c39bc520c1a4e142265 to your computer and use it in GitHub Desktop.
Delete all keys in redis matching a regular expression
This file contains 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
# Deleting all keys in redis that match a regular expression | |
# General | |
redis-cli [options] KEYS "prefix:*" | xargs redis-cli [options] DEL | |
# If authorization is needed | |
redis-cli -a <AUTH> KEYS "prefix:*" | xargs redis-cli -a <AUTH> DEL | |
# If no authorization is needed | |
redis-cli KEYS "prefix:*" | xargs redis-cli DEL | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment