github.com/10XDev/rclone@v1.52.3-0.20200626220027-16af9ab76b2a/docs/content/commands/rclone_lsjson.md (about)

     1  ---
     2  title: "rclone lsjson"
     3  description: "List directories and objects in the path in JSON format."
     4  slug: rclone_lsjson
     5  url: /commands/rclone_lsjson/
     6  # autogenerated - DO NOT EDIT, instead edit the source code in cmd/lsjson/ and as part of making a release run "make commanddocs"
     7  ---
     8  # rclone lsjson
     9  
    10  List directories and objects in the path in JSON format.
    11  
    12  ## Synopsis
    13  
    14  List directories and objects in the path in JSON format.
    15  
    16  The output is an array of Items, where each Item looks like this
    17  
    18     {
    19        "Hashes" : {
    20           "SHA-1" : "f572d396fae9206628714fb2ce00f72e94f2258f",
    21           "MD5" : "b1946ac92492d2347c6235b4d2611184",
    22           "DropboxHash" : "ecb65bb98f9d905b70458986c39fcbad7715e5f2fcc3b1f07767d7c83e2438cc"
    23        },
    24        "ID": "y2djkhiujf83u33",
    25        "OrigID": "UYOJVTUW00Q1RzTDA",
    26        "IsBucket" : false,
    27        "IsDir" : false,
    28        "MimeType" : "application/octet-stream",
    29        "ModTime" : "2017-05-31T16:15:57.034468261+01:00",
    30        "Name" : "file.txt",
    31        "Encrypted" : "v0qpsdq8anpci8n929v3uu9338",
    32        "EncryptedPath" : "kja9098349023498/v0qpsdq8anpci8n929v3uu9338",
    33        "Path" : "full/path/goes/here/file.txt",
    34        "Size" : 6,
    35        "Tier" : "hot",
    36     }
    37  
    38  If --hash is not specified the Hashes property won't be emitted. The
    39  types of hash can be specified with the --hash-type parameter (which
    40  may be repeated). If --hash-type is set then it implies --hash.
    41  
    42  If --no-modtime is specified then ModTime will be blank. This can
    43  speed things up on remotes where reading the ModTime takes an extra
    44  request (eg s3, swift).
    45  
    46  If --no-mimetype is specified then MimeType will be blank. This can
    47  speed things up on remotes where reading the MimeType takes an extra
    48  request (eg s3, swift).
    49  
    50  If --encrypted is not specified the Encrypted won't be emitted.
    51  
    52  If --dirs-only is not specified files in addition to directories are
    53  returned
    54  
    55  If --files-only is not specified directories in addition to the files
    56  will be returned.
    57  
    58  The Path field will only show folders below the remote path being listed.
    59  If "remote:path" contains the file "subfolder/file.txt", the Path for "file.txt"
    60  will be "subfolder/file.txt", not "remote:path/subfolder/file.txt".
    61  When used without --recursive the Path will always be the same as Name.
    62  
    63  If the directory is a bucket in a bucket based backend, then
    64  "IsBucket" will be set to true. This key won't be present unless it is
    65  "true".
    66  
    67  The time is in RFC3339 format with up to nanosecond precision.  The
    68  number of decimal digits in the seconds will depend on the precision
    69  that the remote can hold the times, so if times are accurate to the
    70  nearest millisecond (eg Google Drive) then 3 digits will always be
    71  shown ("2017-05-31T16:15:57.034+01:00") whereas if the times are
    72  accurate to the nearest second (Dropbox, Box, WebDav etc) no digits
    73  will be shown ("2017-05-31T16:15:57+01:00").
    74  
    75  The whole output can be processed as a JSON blob, or alternatively it
    76  can be processed line by line as each item is written one to a line.
    77  
    78  Any of the filtering options can be applied to this command.
    79  
    80  There are several related list commands
    81  
    82    * `ls` to list size and path of objects only
    83    * `lsl` to list modification time, size and path of objects only
    84    * `lsd` to list directories only
    85    * `lsf` to list objects and directories in easy to parse format
    86    * `lsjson` to list objects and directories in JSON format
    87  
    88  `ls`,`lsl`,`lsd` are designed to be human readable.
    89  `lsf` is designed to be human and machine readable.
    90  `lsjson` is designed to be machine readable.
    91  
    92  Note that `ls` and `lsl` recurse by default - use "--max-depth 1" to stop the recursion.
    93  
    94  The other list commands `lsd`,`lsf`,`lsjson` do not recurse by default - use "-R" to make them recurse.
    95  
    96  Listing a non existent directory will produce an error except for
    97  remotes which can't have empty directories (eg s3, swift, gcs, etc -
    98  the bucket based remotes).
    99  
   100  
   101  ```
   102  rclone lsjson remote:path [flags]
   103  ```
   104  
   105  ## Options
   106  
   107  ```
   108        --dirs-only               Show only directories in the listing.
   109    -M, --encrypted               Show the encrypted names.
   110        --files-only              Show only files in the listing.
   111        --hash                    Include hashes in the output (may take longer).
   112        --hash-type stringArray   Show only this hash type (may be repeated).
   113    -h, --help                    help for lsjson
   114        --no-mimetype             Don't read the mime type (can speed things up).
   115        --no-modtime              Don't read the modification time (can speed things up).
   116        --original                Show the ID of the underlying Object.
   117    -R, --recursive               Recurse into the listing.
   118  ```
   119  
   120  See the [global flags page](/flags/) for global options not listed here.
   121  
   122  ## SEE ALSO
   123  
   124  * [rclone](/commands/rclone/)	 - Show help for rclone commands, flags and backends.
   125