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
Post a Comment