github.com/10XDev/rclone@v1.52.3-0.20200626220027-16af9ab76b2a/docs/content/commands/rclone_lsf.md (about) 1 --- 2 title: "rclone lsf" 3 description: "List directories and objects in remote:path formatted for parsing" 4 slug: rclone_lsf 5 url: /commands/rclone_lsf/ 6 # autogenerated - DO NOT EDIT, instead edit the source code in cmd/lsf/ and as part of making a release run "make commanddocs" 7 --- 8 # rclone lsf 9 10 List directories and objects in remote:path formatted for parsing 11 12 ## Synopsis 13 14 15 List the contents of the source path (directories and objects) to 16 standard output in a form which is easy to parse by scripts. By 17 default this will just be the names of the objects and directories, 18 one per line. The directories will have a / suffix. 19 20 Eg 21 22 $ rclone lsf swift:bucket 23 bevajer5jef 24 canole 25 diwogej7 26 ferejej3gux/ 27 fubuwic 28 29 Use the --format option to control what gets listed. By default this 30 is just the path, but you can use these parameters to control the 31 output: 32 33 p - path 34 s - size 35 t - modification time 36 h - hash 37 i - ID of object 38 o - Original ID of underlying object 39 m - MimeType of object if known 40 e - encrypted name 41 T - tier of storage if known, eg "Hot" or "Cool" 42 43 So if you wanted the path, size and modification time, you would use 44 --format "pst", or maybe --format "tsp" to put the path last. 45 46 Eg 47 48 $ rclone lsf --format "tsp" swift:bucket 49 2016-06-25 18:55:41;60295;bevajer5jef 50 2016-06-25 18:55:43;90613;canole 51 2016-06-25 18:55:43;94467;diwogej7 52 2018-04-26 08:50:45;0;ferejej3gux/ 53 2016-06-25 18:55:40;37600;fubuwic 54 55 If you specify "h" in the format you will get the MD5 hash by default, 56 use the "--hash" flag to change which hash you want. Note that this 57 can be returned as an empty string if it isn't available on the object 58 (and for directories), "ERROR" if there was an error reading it from 59 the object and "UNSUPPORTED" if that object does not support that hash 60 type. 61 62 For example to emulate the md5sum command you can use 63 64 rclone lsf -R --hash MD5 --format hp --separator " " --files-only . 65 66 Eg 67 68 $ rclone lsf -R --hash MD5 --format hp --separator " " --files-only swift:bucket 69 7908e352297f0f530b84a756f188baa3 bevajer5jef 70 cd65ac234e6fea5925974a51cdd865cc canole 71 03b5341b4f234b9d984d03ad076bae91 diwogej7 72 8fd37c3810dd660778137ac3a66cc06d fubuwic 73 99713e14a4c4ff553acaf1930fad985b gixacuh7ku 74 75 (Though "rclone md5sum ." is an easier way of typing this.) 76 77 By default the separator is ";" this can be changed with the 78 --separator flag. Note that separators aren't escaped in the path so 79 putting it last is a good strategy. 80 81 Eg 82 83 $ rclone lsf --separator "," --format "tshp" swift:bucket 84 2016-06-25 18:55:41,60295,7908e352297f0f530b84a756f188baa3,bevajer5jef 85 2016-06-25 18:55:43,90613,cd65ac234e6fea5925974a51cdd865cc,canole 86 2016-06-25 18:55:43,94467,03b5341b4f234b9d984d03ad076bae91,diwogej7 87 2018-04-26 08:52:53,0,,ferejej3gux/ 88 2016-06-25 18:55:40,37600,8fd37c3810dd660778137ac3a66cc06d,fubuwic 89 90 You can output in CSV standard format. This will escape things in " 91 if they contain , 92 93 Eg 94 95 $ rclone lsf --csv --files-only --format ps remote:path 96 test.log,22355 97 test.sh,449 98 "this file contains a comma, in the file name.txt",6 99 100 Note that the --absolute parameter is useful for making lists of files 101 to pass to an rclone copy with the --files-from-raw flag. 102 103 For example to find all the files modified within one day and copy 104 those only (without traversing the whole directory structure): 105 106 rclone lsf --absolute --files-only --max-age 1d /path/to/local > new_files 107 rclone copy --files-from-raw new_files /path/to/local remote:path 108 109 110 Any of the filtering options can be applied to this command. 111 112 There are several related list commands 113 114 * `ls` to list size and path of objects only 115 * `lsl` to list modification time, size and path of objects only 116 * `lsd` to list directories only 117 * `lsf` to list objects and directories in easy to parse format 118 * `lsjson` to list objects and directories in JSON format 119 120 `ls`,`lsl`,`lsd` are designed to be human readable. 121 `lsf` is designed to be human and machine readable. 122 `lsjson` is designed to be machine readable. 123 124 Note that `ls` and `lsl` recurse by default - use "--max-depth 1" to stop the recursion. 125 126 The other list commands `lsd`,`lsf`,`lsjson` do not recurse by default - use "-R" to make them recurse. 127 128 Listing a non existent directory will produce an error except for 129 remotes which can't have empty directories (eg s3, swift, gcs, etc - 130 the bucket based remotes). 131 132 133 ``` 134 rclone lsf remote:path [flags] 135 ``` 136 137 ## Options 138 139 ``` 140 --absolute Put a leading / in front of path names. 141 --csv Output in CSV format. 142 -d, --dir-slash Append a slash to directory names. (default true) 143 --dirs-only Only list directories. 144 --files-only Only list files. 145 -F, --format string Output format - see help for details (default "p") 146 --hash h Use this hash when h is used in the format MD5|SHA-1|DropboxHash (default "MD5") 147 -h, --help help for lsf 148 -R, --recursive Recurse into the listing. 149 -s, --separator string Separator for the items in the format. (default ";") 150 ``` 151 152 See the [global flags page](/flags/) for global options not listed here. 153 154 ## SEE ALSO 155 156 * [rclone](/commands/rclone/) - Show help for rclone commands, flags and backends. 157