Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

redis-commands

using different database at redis command prompt

April 18, 2023 by Tarik

Just use the -n argument to choose DB number. It available since Redis 2.4.2. echo -n “testing” | redis-cli -n 4 -x set my_pass or redis-cli -n 4 set my_pass testing

Categories redis Tags redis, redis-commands Leave a comment

How do I remove keys?

January 7, 2023 by Tarik

Another compact one-liner I use to do what you want is: redis-cli KEYS “user*” | xargs redis-cli DEL

Categories database Tags database, redis, redis-commands Leave a comment

Redis command to get all available keys?

September 10, 2022 by Tarik

Try to look at KEYS command. KEYS * will list all keys stored in redis. EDIT: please note the warning at the top of KEYS documentation page: Time complexity: O(N) with N being the number of keys in the database, under the assumption that the key names in the database and the given pattern have … Read more

Categories redis Tags redis, redis-cli, redis-commands Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa