How do I do a reverse search on command history in redis-cli? Typing the starting letters and pressing the up arrow doesn't work. Neither does bash style 'ctrl+r'. Please help.
Is there a file where redis saves the command history.
The Redis command line interface ( redis-cli ) is a terminal program used to send commands to and read replies from the Redis server.
To start Redis client, open the terminal and type the command redis-cli. This will connect to your local server and now you can run any command. In the above example, we connect to Redis server running on the local machine and execute a command PING, that checks whether the server is running or not.
To list the keys in the Redis data store, use the KEYS command followed by a specific pattern. Redis will search the keys for all the keys matching the specified pattern. In our example, we can use an asterisk (*) to match all the keys in the data store to get all the keys.
For a clustered cache, you would see shards instead. From there, you can expand a cache resource to view all the keys inside it. By clicking on a Redis key name, all its contents will open in a new editor tab. With a collection type Redis key, clicking on it will reveal the individual elements under the key name.
How do I do a reverse search on command history in redis-cli?
redis-cli
uses linenoise which does not support (yet) reverse search within the history:
/* linenoise.c */
History search like Ctrl+r in readline?
Is there a file where redis saves the command history?
That being said Redis saves the commands history under ~/.rediscli_history
which can be obtained with up arrow key.
Also, it supports command auto-completion via the tab key.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With