List of objects

The scheme ls command lets you get a list of objects in the database:

  1. ydb [connection options] scheme ls [path] [-lR]

List of objects - 图1

where [connection options] are database connection options

Executing the command without parameters produces a compressed list of object names in the database’s root directory.

In the path parameter, you can specify the directory you want to list objects in.

The following options are available for the command:

  • -l : Full details about attributes of each object
  • -R : Recursive traversal of all subdirectories

Examples

The examples use a profile named db1. For information about how to create it, see the Getting started with the YDB CLI article in the “Getting started “ section.

  • Getting objects from the root database directory in a compressed format
  1. ydb --profile db1 scheme ls

List of objects - 图2

  • Getting objects in all database directories in a compressed format
  1. ydb --profile db1 scheme ls -R

List of objects - 图3

  • Getting objects from the given database directory in a compressed format
  1. ydb --profile db1 scheme ls dir1
  2. ydb --profile db1 scheme ls dir1/dir2

List of objects - 图4

  • Getting objects in all subdirectories in the given directory in a compressed format
  1. ydb --profile db1 scheme ls dir1 -R
  2. ydb --profile db1 scheme ls dir1/dir2 -R

List of objects - 图5

  • Getting complete information on objects in the root database directory
  1. ydb --profile db1 scheme ls -l

List of objects - 图6

  • Getting complete information about objects in a given database directory
  1. ydb --profile db1 scheme ls dir1 -l
  2. ydb --profile db1 scheme ls dir2/dir3 -l

List of objects - 图7

  • Getting complete information about objects in all database directories
  1. ydb --profile db1 scheme ls -lR

List of objects - 图8

  • Getting complete information on objects in all subdirectories of a given database directory
  1. ydb --profile db1 scheme ls dir1 -lR
  2. ydb --profile db1 scheme ls dir2/dir3 -lR

List of objects - 图9