Redis client commands I want to remember

May 18, 2024 note-to-self

In laravel local, while devving vendor/bin/sail redis redis-cli (command, container, client)

In forge/prod:

# redis-cli // start the redis client
> info Keyspace
> select 1 // (db1, select 1; db0, select 0, etc)
> keys *
> flushall
> get <key>

Delete keys based on a part:

# redis-cli -n 0 --scan --pattern '<pattern>*'| xargs redis-cli -n 0 unlink