How to dump directory structure into one directory with copy

How can I copy all files from all directories on the remote to one local directory?

For example:

Remote:
dir1
- File 1
- File 2
dir 2
- File 3
- File 4

Local:
dir:
- File 1
- File 2
- File 3
- File 4

That isn’t possible in one command yet…

You could just do a normal rclone copy then use this recipe https://unix.stackexchange.com/a/435533/94054 to get them all into one directory.

rclone lsf remote:folder --files-only --recursive| sed -r -e "s/^.*\/([^\/]*)$/rclone copyto remote:folder\/& \1/e"

if filenames with spaces, add double quotes

rclone lsf remote:folder --files-only --recursive| sed -r -e "s/^.*\/([^\/]*)$/rclone copyto remote:\"folder\/&\" \"\1\"/e"
1 Like