将文件内容写入 Redis
-x 表示最后一个参数从 STDIN 读入:
redis-cli -x HSET some_key image_binary <some.jpg将 Redis 中读取到的内容写入文件中
由于 Redis 会在读出来的内容后面加上一个 \n,需要用 head(MacOS 上使用 ghead)移除掉:
redis-cli --raw HGET some_key image_binary | head -c-1 >img.jpg-x 表示最后一个参数从 STDIN 读入:
redis-cli -x HSET some_key image_binary <some.jpg由于 Redis 会在读出来的内容后面加上一个 \n,需要用 head(MacOS 上使用 ghead)移除掉:
redis-cli --raw HGET some_key image_binary | head -c-1 >img.jpg