Find all the files and copy them to a folder (align recursively)

Basically, I have a very large file system containing media. It has a ton of silly subfolders. I would like to find all files (any file) and copy them to a directory. What is the best / easiest way to do this?

Suppose the media directory is in / home / user / media and the location of the destination directory is / home / user / flatmedia

I would like to do this using standard mac tools.

+6
source share
1 answer

find /home/user/media -type f -exec cp {} /home/user/flatmedia \;

Note. If there are any duplicates, there is no specific guarantee of which one you will receive.

+18
source

Source: https://habr.com/ru/post/958839/


All Articles