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

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

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -