How to Copy Files Recursively in Linux with ‘cp’

You can type this command to copy files recursively in linux, from one folders to another with:

cp -R /path/to/sources/* /path/destination/

but, when one or more files is already exists on the destination, you have to type ‘yes’ answer all the time. So, you can use this simple and yet silly trick:

yes | cp -aR /path/to/sources/* /path/destination/

Try it,

Wagiman Wiryosukiro

Petani Sistem Informasi, tukang las plugin & themes Wordpress. Co-Founder Saat ini aktif sebagai Developer & kontributor di OpenMandriva Linux.

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: