linux - Flush specific Redis DB using a single command -


in order flush specific redis database, need following:

  • enter redis interactive cli (> redis-cli)
  • select database (> select 0)
  • flush db (> flushdb)

but there way run these 2 interactive commands single shell command? can pass 1 command interactive application using pipe: "echo select 0" | redis-cli, not both of them.

you can select database call cli using -n switch.

for running more 1 command, redirect file instead of piping echo, or feed cli raw protocol --pipe switch.


Comments

Popular posts from this blog

many to many - Django Rest Framework ManyToMany filter multiple values -

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

Java Entity Manager - JSON reader was expecting a value but found 'db' -