I need to sync remotes files to local with the following command:

rsync -schavzP --stats --files-from=./filelist.txt -e "ssh -p 22" [email protected]:/home/somewhere/ .

While filelist.txt contains several subfolder filenames:


The command gives the following error:

rsync: link_stat "/home/somewhere/subfolder/746fbd52ec4441b88f62ead5beb8e57e" failed: No such file or directory

If I issue rsync without files-from, and give the remote filename directly in command line, it works.

Appreciate if someone could lend me a hand. Thank you.

  • 2
    You did verify that the file does exist?
    – RalfFriedl
    Aug 28, 2018 at 16:40
  • Yes definitely. I can rsync the file by command line
    – Kenny Tse
    Aug 29, 2018 at 1:47
  • Show the output from ls -l /home/somewhere/subfolder/746fbd52ec4441b88f62ead5beb8e57e, copy the path exactly from the error message rsync gives. Run `strace -f -e file rsync ..." and show the line that refers to this file. Append the information to the question, not as a comment.
    – RalfFriedl
    Aug 29, 2018 at 5:22
  • @RalfFriedl It lists the file is there. Nothing special. Thank you for your input. I found the real cause finally.
    – Kenny Tse
    Aug 29, 2018 at 7:21

1 Answer 1


As usual it turns out the real cause is not what I think it was.

The "filelist.txt" was an UTF8 textfile which has BOM codes at the beginning of the file as hidden codes. Even "vi", "vim", "nano" are not able to show them.

Removed all those hidden codes and the above rsync codes inside bash script should work.

Sorry for the chaos.

  • 1
    Would you please add into your answer how did you delete that BOM characters bytes ? Aug 29, 2018 at 10:32

You must log in to answer this question.

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