LL   (list long format)

Apply for Redis Developer Course Redis Regular Inspection / Technical Support Redis Enterprise Server

List keys

The usage is ll or ll pattern.

Example

Command>ll     With no option, all keys are listed
Result> 0) type|key|value|last_update_time|expire_time
1) set|myset1|5|[2025-05-07 17:11:45]|[]
2) string|mystr2|value30|[2025-05-07 17:11:29]|[2025-08-15 17:12:38]
3) string|mystr4|value20|[2025-05-07 17:11:29]|[]
4) list|mylist2|5|[2025-05-07 17:11:40]|[]
5) string|mystr3|value50|[2025-05-07 17:11:29]|[]
6) set|myset2|5|[2025-05-07 17:11:51]|[]
7) string|mystr1|value10|[2025-05-07 17:11:29]|[2025-05-17 17:12:32]
8) string|mystr5|value40|[2025-05-07 17:11:29]|[]
9) list|mylist1|5|[2025-05-07 17:11:35]|[]

Field description

  • type: Shows the key's data type. Data types are string/list/set/zset/hash/stream.
  • key: Shows the key.
  • value: For string, shows the value; for other data types, shows the number of values.
  • last_update_time: Shows when the key was created or last updated.
    This field is not in the open source version; it is managed in the Enterprise version.
  • expire_time: Shows the expiration time if it was set with the expire command.

You can use a glob-style pattern.
  • * : Matches any characters: h*llo -> hllo, heeeello, etc
  • ? : Matches one character: h?llo -> hallo, hello, hxllo, etc
  • [alphabet] : Matches a character in the brackets: h[ae]llo -> hallo, hello
  • [^e] : Matches any character except those in the brackets: h[^e]llo -> hallo, hbllo, ... but hello is excluded.
  • [a-c] : Matches a character range in the brackets: h[a-c]llo -> hallo, hbllo, hcllo
  • \ : To use the special characters above (*?[^]) as literals, prefix them with \.

Example

Command>ll *   List keys
Result> 0) type|key|value|last_update_time|expire_time
1) set|myset1|5|[2025-05-07 17:11:45]|[]
...
9) list|mylist1|5|[2025-05-07 17:11:35]|[]
Command>ll myset*   List keys that start with myset
Result> 0) type|key|value|last_update_time|expire_time
1) set|myset1|5|[2025-05-07 17:11:45]|[]
2) set|myset2|5|[2025-05-07 17:11:51]|[]

Specify a data type

You can specify a data type to list only those keys.
Specifying a data type is recommended.
Available data types are string, list, set, zset, hash, and stream.

Example

Command>ll * list
Result> 0) type|key|value|last_update_time|expire_time
1) list|mylist2|5|[2025-05-07 17:11:40]|[]
2) list|mylist1|5|[2025-05-07 17:11:35]|[]

Syntax

LL   [key_pattern]   [string|list|set|zset|hash|stream]   [COUNT count]

  • Available since Ent 7.5.0.
  • Time complexity is O(N). N is the number of all keys in the database, not the number of keys returned.
  • An output (query) limit is set with the redis.conf ll-max parameter.
    If the number of keys is greater than or equal to ll-max, the following message is shown and the keys are not listed.
    "If the number of keys is greater than ll-max, the 'll' command cannot be executed.
    To execute, modify the 'CONFIG SET ll-max number' command.
    The number of keys can be checked with the 'dbsize' command, and the 'll-max' value can be checked with the 'CONFIG GET ll-max' command."
    You can change the value with the 'CONFIG SET ll-max number' command.
    On production servers, using the 'COUNT count' option is recommended.
Related commands LS, KEYS

<< LS LL RM >>

Email 답글이 올라오면 이메일로 알려드리겠습니다.