redis Redis Keys Listing all keys

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

You can list all of the keys in a Redis database by executing the following commands from redis-cli:

KEYS *

The parameter to KEYS is a glob-style pattern matching expression. Examples of suppored patterns include:

h?llo matches hello, hallo and hxllo
h*llo matches hllo and heeeello
h[ae]llo matches hello and hallo, but not hillo
h[^e]llo matches hallo, hbllo, ... but not hello
h[a-b]llo matches hallo and hbllo

Using the KEYS * command can have adverse affects on performance, so it is not recommended against production instances. Use the SCAN operation to search for keys in production code.



Got any redis Question?