I believe the question is best asked with an example.
/home
test1.txt
test2.txt
/home/my-folder
test3.txt
test4.txt
test1.txt
,test2.txt
andmy-folder
folder are inside/home
.test3.txt
andtext4.txt
are inside/home/my-folder
.
I want to copy all the contents of /home
folder but exclude the 2 files (test3.txt
and test4.txt
) inside my-folder
.
How can I do it using cp
?
I know it's possible with rsync
as I just tried it but there are times when rsync
is not installed in a server and I don't have rights to install software.