Forked from MattSurabian/redis-one-line--pattern-delete.sh
Created
June 9, 2017 04:38
-
-
Save michaellouieloria/4f3bdb4b2e8aa07d926f98d417dc0a2c to your computer and use it in GitHub Desktop.
One liner for deleting based on a pattern in redis. KEYS supports wildcards, delete doesn't. No worries xargs to the rescue. You might not need HOST, or PORT depending on your setup. You might need to sudo BOTH commands depending on your setup.
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
redis-cli -h <HOST> -p <PORT> KEYS "<PATTERN>" | xargs -i% redis-cli -h <HOST> -p <PORT> DEL % |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment