title: How to bulk delete hundreds of thousands of keys with special characters in Redis
body: <p>We have a list of hundreds of thousands of Redis keys containing all sorts of special characters and we would like to bulk delete them. There are some great answers to a similar problem on this question: <a href="https://stackoverflow.com/questions/4006324/how-to-atomically-delete-keys-matching-a-pattern-using-redis/23399125#23399125">How to atomically delete keys matching a pattern using Redis</a></p>
  
  <p>HOWEVER, I can't seem to find an answer for the case where:</p>
  
  <ol>
  <li>We have a large number of keys (hundreds of thousands)</li>
  <li>The keys have all manners of special characters like double quotes ("), backslashes (), all sorts of weird Unicode characters, etc.</li>
  <li>We are using the windows redis-cli client</li>
  <li>Bonus: Ideally we would be able to issue this command as part of a MULTI/EXEC transaction so we can also delete a SET atomically along with the keys.</li>
  </ol>
  
  <p>I would LOVE if we could just do something like the below, but have it handle keys with all of the special characters that give Redis problems:</p>
  
  <p><code>redis-cli SMEMBERS "myGiganticListOfKeys" | xargs --delim='\n' redis-cli DEL</code></p>
  
  <p>Unfortunately this just gives the below error:</p>
  
  <p><code>"C:/Program Files (x86)/Git/bin/xargs.exe": redis-cli: Bad file number</code></p>
  
  <p>I think this would otherwise work if we didn't have special characters in the keys.</p>
  
  <p>Thanks so much in advance.</p>