LL   (list long format) - old version

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

List keys - old version reference page (currently unused)

The usage is ll or ll pattern.
'll' lists all keys.
This command is available on Enterprise Server. (available regardless of use-sql yes/no)
The intent of this command: there is an 'ls' command, but it can be used only when 'use-sql yes' is set, and its many options are hard to remember, so it is often unused. This command shows the needed fields by default and keeps options simple.
Caution: like the 'keys' command, it full-scans all keys in the DB, so use it carefully.

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 all 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. 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]|[]

Specify 'type'

If you specify 'type', it shows each data type and the number of keys of that type.

Example

Command>ll * type
Result> 0) type|count
1) string|5
2) list|2
3) set|2
4) zset|0
5) hash|0
6) module|0
7) stream|0

Specify a sort option

  • SORT/ASC/DESC: Sort by key. SORT/ASC is ascending, DESC is descending.

Example

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

Syntax

LL   [pattern]   [string|list|set|zset|hash|stream|type]   [sort|asc|desc]

  • Available since Enterprise version 7.5.0.
  • Time complexity is O(N). N is the number of all keys in the database, not the number of keys returned.
  • Like the 'keys' command, this command 'full scans' the DB and can affect server performance, so a 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.
    Use this command on development/test servers, and avoid it on production servers unless it is necessary.
Related commands LS, KEYS


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