Suppose I have folder structure:

folder: a.text

folder_2: folder_3: a.text

How I can sync this file without mentioning the full destination path?

I have tried

rsync -hvrPt folder/* folder_2 

but it creates a new file under folder_2, instead I just want to update the a.text from folder to folder_2 without mentioning the full destination path.

I have tried

rsync --update

also but it didn't work.

Could anybody help me with this?

  • Not rsync but GNU cp(1) has the -u flag, just my two cents.
    – Jetchisel
    Feb 20, 2020 at 23:56

1 Answer 1


It seems like you want rsync to update every found instance of the file. It won't do that. If you have just one file to update everywhere found in the target, you could try:

find folder_2 -name a.text -exec rsync -hvPt folder/a.text {} \; # no need for -r

I am not sure what you are doing with -h, unless you have really have hard links. It makes me think you are trying to update links versus files. Unless you have a good use case, you should probably use soft links (ln -s) as they can span file systems.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .