Created
April 26, 2016 06:16
-
-
Save lilongen/ffb3b9821755559e589d74716e6efb7c 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