# Copy to a single flat directory

**URL:** <https://forum.rclone.org/t/copy-to-a-single-flat-directory/52127>\
**Category:** Feature\
**Created:** [August 2, 2025, 3:48pm UTC](https://forum.rclone.org/t/copy-to-a-single-flat-directory/52127 "2025-08-02T15:48:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![noobian](https://forum.rclone.org/letter_avatar_proxy/v4/letter/n/41988e/32.png) [@noobian](https://forum.rclone.org/u/noobian)\
**Post date:** [August 2, 2025, 3:48pm UTC](https://forum.rclone.org/t/copy-to-a-single-flat-directory/52127/1 "2025-08-02T15:48:59Z")

</div>

Hi, is this already possible or if not is it possible to be added for rclone copy and move, in a scenario where we have files in multiple source directories, is it possible to output them to a single output directory i.e:

Folder 1/File 1 \> Remote Folder/File 1  
Folder 2/File 2 \> Remote Folder/File 2  
Folder 3/File 3 \> Remote Folder/File 3

I understand the issue of filename conflicts may arise but renaming is a possible solution.

To add more information on my usecase, I have a read only source remote, and another remote that is slow with api calls, so moving lots of files after to a single directory takes alot of time and it would be nice if it could be done on the initial copy.

Thank you

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://forum.rclone.org/user_avatar/forum.rclone.org/kapitainsky/32/14450_2.png) [@kapitainsky](https://forum.rclone.org/u/kapitainsky)\
**Post date:** [August 2, 2025, 6:04pm UTC](https://forum.rclone.org/t/copy-to-a-single-flat-directory/52127/2 "2025-08-02T18:04:01Z")

</div>

It is not possible with rclone only today but should be rather easy to script.

For single file with given path you simply:

`rclone copy source/path/file destination/path/`

Now you just get list of all source files (with path) and loop over it executing `rclone copy`.

Details will depend on your OS and scripting language you use but it should be just few lines of code to have working proof of concept.

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://forum.rclone.org/user_avatar/forum.rclone.org/kapitainsky/32/14450_2.png) [@kapitainsky](https://forum.rclone.org/u/kapitainsky)\
**Post date:** [August 2, 2025, 6:10pm UTC](https://forum.rclone.org/t/copy-to-a-single-flat-directory/52127/3 "2025-08-02T18:10:49Z")

</div>

On second thoughts I think you could make it even easier and use `--files-from` filtering flag.

> **[Rclone Filtering](https://rclone.org/filtering/#files-from-read-list-of-source-file-names)**
>
> Rclone filtering, includes and excludes

Generate your list and give it a try.

You can get such list by running something like:

```auto
rclone lsf --files-only --recursive --format p /root/of/source

```

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [October 1, 2025, 6:11pm UTC](https://forum.rclone.org/t/copy-to-a-single-flat-directory/52127/4 "2025-10-01T18:11:02Z")

</div>

Closed on October 1, 2025, 6:11pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
