markthegrea
markthegrea

Reputation: 3851

Why do I get "(error) ERR unknown command: redis-cli" when in the REDIS console?

I am trying to delete some keys but cannot execute any redis-cli commands:

redis-cli --scan --patter 'assetInfo*' | xargs redis-cli del

The error is:

(error) ERR unknown command: redis-cli

I am using REDIS version 3.2.7. Does this version not support redis-cli?

What gives?

Update: When I do this without 'redis-cli' I get this:

Azure Redis Health Dev:0>--scan --pattern 'spout*' | xargs redis-cli del
ERR unknown command: --scan

Upvotes: 1

Views: 10153

Answers (1)

Itamar Haber
Itamar Haber

Reputation: 50082

The error you're getting is a Redis error, which means you're already connected (and probably inside the cli). redis-cli is a command line (i.e. shell) utility for opening a connection to Redis and running commands.

P.S. your --pattern switch is missing an "n"

Upvotes: 2

Related Questions