Easy Tutorial
❮ Lists Ltrim Strings Getset ❯

Redis Client Kill Command

Redis Server

The Redis Client Kill command is used to close a client connection.

Syntax

The basic syntax for the redis Client Kill command is as follows:

redis 127.0.0.1:6379> CLIENT KILL ip:port

Available Versions

= 2.4.0

Return Value

Returns OK upon successful closure.

Example

# List all connected clients

redis 127.0.0.1:6379> CLIENT LIST
addr=127.0.0.1:43501 fd=5 age=10 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client

# Kill the current client connection

redis 127.0.0.1:6379> CLIENT KILL 127.0.0.1:43501
OK

# The previous connection has been closed, and the CLI client has reestablished a connection
# The previous port was 43501, now it is 43504

redis 127.0.0.1:6379> CLIENT LIST
addr=127.0.0.1:43504 fd=5 age=0 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client

Redis Server

❮ Lists Ltrim Strings Getset ❯