↑ ↓ select, Enter open, Esc close

Connect to Redis over a Unix socket

Adjust the values, the command updates live
user@server
redis-cli -s /run/redis/redis-server.sock ping

With -s, redis-cli uses the given socket instead of opening a TCP connection to 127.0.0.1:6379. Any other Redis command works in place of ping. The socket is faster than TCP and not reachable from outside, and in the Debian configuration it has to be enabled via unixsocket in /etc/redis/redis.conf.

Note: Permission denied means the user is not in the redis group or unixsocketperm is too restrictive. redis-cli CONFIG GET unixsocket shows the actual path.

Also searched as

  • test redis socket
  • redis without tcp port
  • redis-cli unixsocket

Related one-liners

All in Redis and Memcached

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.