Copy only files, not folder structure from a directory in Unix [closed] Copy only files, not folder structure from a directory in Unix [closed] unix unix

Copy only files, not folder structure from a directory in Unix [closed]


find path-to-source-file-tree -type f -exec cp {} path-to-target-dir \;

That should take care of all your issues.

To customize it further you can refer: man find For example, based on date and time, file types, file owners, etc. you can customize the above statement.


I would use find, cannot find a flag in my GNU Coreutils 8.5 cp about not-preserving directory-structure. Anyway the one-liner:

find . -type f -exec cp '{}' ~/Backup/ \;