Publish a message
Publish a message to a Redis pub/sub channel
redis-cli PUBLISH events '{"type":"login","user":"alice"}'
More redis commands
-
redis-cli SUBSCRIBE eventsSubscribe to a channel and listen for messages
-
redis-cli INFO replicationShow the role, connected replicas and replication lag
-
redis-cli BGSAVE && redis-cli LASTSAVEStart a background RDB save and print the last save time (it changes only when BGSAVE finishes)
-
redis-cli -n 1 FLUSHDB ASYNCDelete all keys in database 1 only, in the background
-
redis-cli ZREVRANGEBYSCORE leaderboard +inf -inf WITHSCORES LIMIT 0 10Show the top 10 entries of a sorted set with their scores