Skip to content

Instantly share code, notes, and snippets.

@simeonwillbanks
Created October 2, 2013 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simeonwillbanks/6798170 to your computer and use it in GitHub Desktop.
Save simeonwillbanks/6798170 to your computer and use it in GitHub Desktop.
Redis Bulk Operations #redis #xargs #wc #unix
# Count all keys which match a wildcard from database 1
redis-cli -n 1 KEYS "foo:*" | wc -l
# Delete all keys which match a wildcard from database 1
redis-cli -n 1 KEYS "foo:*" | xargs redis-cli -n 1 DEL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment