Command Line Client/View Data

Metadata

You can list any data object's (or any other DNAnexus entity's) metadata using dx describe. You can give it any path or name/ID of an app, job, or username, and it will report all results it finds.

$ dx describe foo\ bar Result 1: ID file-B09P1Zf4Zg2FJF1Xz0V00001 Class file Project project-9zVpbQf4Zg2641v5BGY00001 Folder / Name foo bar State open Visibility visible Types - Properties foo=bar, foo2=bar2 Tags foo Outgoing links - Created Fri Jul 27 12:49:38 2012 Created by alice Last modified Mon Jul 30 13:26:53 2012 Media type parts {} Result 2: ID file-B09P1kK4Zg2FJF1Xz0V00003 Class file Project project-9zVpbQf4Zg2641v5BGY00001 Folder / Name foo bar State closed Visibility visible Types - Properties foo=bar, foo2=bar2 Tags foo Outgoing links - Created Fri Jul 27 12:49:57 2012 Created by alice Last modified Mon Jul 30 13:26:53 2012 Media type text/plain Size 4 bytes

By default, the JSON details are not returned in the results of describe, but you can turn it on with the ‑‑details flag. You can also ask for the response in JSON (though this will throw an error if there are multiple results; use ‑‑multi to always receive an array of JSON hashes describing the results).

To get just the details in a pretty-printed format, use dx get_details.

$ dx get_details myrecord
{
    "hello": [
        "world",
        2,
        3,
        true,
        {
            "foo": null
        }
    ]
}

View part of a file

By default, dx head allows you to view either the first 10 lines of a file.

Examples

You can change the number of lines with ‑n.

$ dx head foo.txt -n 3
1st line of foo.txt
2nd
3rd and last one before the rest of the file is truncated.

Print file to stdout

To download and print a file directly to stdout, use dx cat.

$ dx cat foo.txt
This is the content of foo.txt

Last edited by Thanh-Ha Nguyen, 2016-02-17 18:55:56

 Feedback