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