2020-02-24 16:04:30 +00:00
|
|
|
# Redis
|
|
|
|
|
2020-05-09 16:16:00 +00:00
|
|
|
Docker:
|
2020-03-11 14:48:59 +00:00
|
|
|
|
|
|
|
```sh
|
2020-05-09 16:16:00 +00:00
|
|
|
docker run -d \
|
|
|
|
-p 6379:6379 \
|
|
|
|
--name redis \
|
|
|
|
redis:alpine
|
2020-02-24 16:04:30 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## redis-cli
|
|
|
|
|
2020-05-09 18:30:08 +00:00
|
|
|
`redis-cli` is included in:
|
|
|
|
|
|
|
|
| Distribution | Package |
|
|
|
|
| ------------ | -------------- |
|
|
|
|
| Archlinux | `redis` |
|
|
|
|
| Ubuntu | `redis-server` |
|
2020-05-09 16:16:00 +00:00
|
|
|
|
2020-02-24 16:04:30 +00:00
|
|
|
Connect:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
redis-cli -h localhost -p 6379
|
|
|
|
```
|
|
|
|
|
2020-05-09 16:16:00 +00:00
|
|
|
### [Commands](https://redis.io/commands)
|
2020-02-24 16:04:30 +00:00
|
|
|
|
|
|
|
Get all keys:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
KEYS *
|
|
|
|
```
|
|
|
|
|
|
|
|
Delete all keys:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
FLUSHALL
|
|
|
|
```
|