Copy Contents Of Directory To Another Directory Using cp in Bash

This command will copy the contents of dir2 and place them into dir4 using BASH shell.

-u or –update is optional and will only copy if source file in newer.
-R or –recursive will copy all sub directories.

cp dir1/dir2/. dir3/dir4 -R -u

Leave a Reply

Your email address will not be published. Required fields are marked *