# Redis Client Getname Command
Redis Server
The Redis CLIENT GETNAME command returns the name previously set for the connection using the
CLIENT SETNAME command. Since newly created connections have no name by default, CLIENT GETNAME returns a null reply for unnamed connections.
### Syntax
The basic syntax of the Redis CLIENT GETNAME command is as follows:
redis 127.0.0.1:6379> CLIENT GETNAME
### Available since
>= 2.6.9
### Return value
Returns a null reply if the connection has no name; otherwise, returns the name.
### Examples
# A new connection has no name by default
redis 127.0.0.1:6379> CLIENT GETNAME
(nil)
# Set a name
redis 127.0.0.1:6379> CLIENT SETNAME hello-world-connection
OK
# Retrieve the name
redis 127.0.0.1:6379> CLIENT GETNAME
"hello-world-connection"
Redis Server