Redis Strings
# Redis Strings
Redis string data type related commands are used to manage Redis string values. The basic syntax is as follows:
### Syntax
redis 127.0.0.1:6379> COMMAND KEY_NAME
### Example
redis 127.0.0.1:6379> SET tutorialkey redis OK redis 127.0.0.1:6379> GET tutorialkey "redis"
In the above example, we used the **SET** and **GET** commands, with the key being **tutorialkey**.
* * *
## Redis String Commands
The following table lists commonly used Redis string commands:
| No. | Command and Description |
| --- | --- |
| 1 | (#) Sets the value of the specified key. |
| 2 | (#) Gets the value of the specified key. |
| 3 | (#) Returns a substring of the string value stored at the key. |
| 4 | (#) Sets the value of the given key to value and returns the old value of the key. |
| 5 | (#) Gets the bit at the specified offset in the string value stored at the key. |
| 6 | [MGET key1 [key2..]](#) Gets the values of all (one or more) specified keys. |
| 7 | (#) Sets or clears the bit at the specified offset in the string value stored at the key. |
| 8 | (#) Associates the value with the key and sets the expiration time for the key to seconds. |
YouTip