scp giving Error "No such file or directory" while trying to copy a remote server file name with special char '

Viewed 28

How to handle file name with special character while copying using scp. it is giving me the below error .

the file name i am trying to copy =  u3'T'volavg.dat
Error says = scp: ./RBC_ML/run_dir/u3Tvolavg.dat: No such file or directory

So from the above error, one can see that it is searching for file name u3Tvolavg.dat, although I have given the filename to copy as u3'T'volavg.dat I have tried all the below possible syntax.

scp user@hostIp:Remote_dir/x <Local machine path>
  x = u3`'T`'volavg.dat

  x = "u3'T'volavg.dat"

  x = 'u3''T''volavg.dat'

Can even scp handle ' chars?

1 Answers

Here's one way you can do it:

scp -T pi@192.168.14.2:"\"/home/pi/u3'T'volavg.dat\"" .
u3'T'volavg.dat                                                                       100%    0     0.0KB/s   00:00
Related