Searching Data Objects
Last updated
Was this helpful?
Last updated
Was this helpful?
You can use the command to list the objects in your current project. You can learn which project and folder you are currently in by using the command . Using glob patterns, you can broaden your search for objects by specifying filenames with wildcard characters such as *
and ?
. An asterisk (*
) is used to represent zero or more characters in a string, and a question mark (?
) represents exactly one character.
By listing objects in your current directory with the wildcard characters *
and ?
, you can search for objects with a filename using a glob pattern. Here we take folder "C. Elegans - Ce10/" in the public project (platform login required to access this link) and walk through these examples:
As described above, if your file contains special characters in their filename, the special characters should be escaped when searching. Additionally, as a colon (:
) is used to denote project names and a slash (/
) is used to separate folder names on the platform, they are also special characters, so we will also need to escape these two characters when they appear in a data object's name. To escape any special characters, you will use a preceding backslash \
.
Please note that while dx-toolkit itself requires a single \ to escape a colon or a slash, the syntax conventions in some shells may require you to escape the \ character itself by an extra backslash or by enclosing the argument in single quotes.
dx find data
also allows you to search data using metadata fields, such as when the data was created, the data's tags, or the project the data exists in.
You can utilize the flags --created-after
and --created-before
to search for data objects created within a period of time.
To search by object properties, use the option --property
. This option can be repeated if the search requires multiple properties.
If you would like to search for data objects live in all projects in which you have VIEW and above permissions, you can use the --all-projects
flag. Public projects are not shown in this search.
To describe data for small amounts of files (typically below 100), scope findDataObjects
to only a project level.
The below is an example of code used to scope a project:
If you wish to search the entire project with a filename pattern, you can utilize the command dx find data --name
with the wildcard characters. Unless --path
or --all-projects
is specified, dx find data
searches data under the current project. Below, we use the command dx find data
in the public project (platform login required to access this link) using the --name
option to specify the filename of objects that we're searching for.
You can search for objects based on their metadata. An object's metadata can be set by performing the command or to respectively tag or setup key-value pairs to describe your data object. You can also set metadata while uploading data to the platform. To search by object tags, use the option --tag
. This option can be repeated if the search requires multiple tags.
You can search for an object living in a different project than your current working project by specifying a project and folder path with the flag --path
. Below, we specify the project ID (project-BQfgzV80bZ46kf6pBGy00J38) of the public project (platform login required to access this link) as an example.
See the for more information about usage.