flogiston

Blog

Unix - Copy files

· admin · Dev, Linux

For one project we wanted to duplicate the i18n files of a codeigniter application to a new locale. This is how my colleague did it.

# Copy all dirs named 'fr_FR' to a 'fr_LU' dir in the same parent dir as the
original 'fr'


find ./ -name 'fr_FR' -exec cp -R {} {}/../fr_LU  \;

#Copy all dirs matching a specific name, together with their content to
another directory:


find ./ -name 'fr_LU' -exec cp -R {} /projects/a_project/application/views/{} \;