but if you have to scp files with spaces in them and you dont do it right you can get a stupid
scp: ambiguous target
error, which can be quite unfun.example:
scp "Other Linux 2.6.x kernel-cl1.vmdk" root@192.168.0.1:"Other Linux 2.6.x kernel-cl1.vmdk"
root@192.168.0.1's password:
scp: ambiguous target
The issue is that even though its in quotes scp is looking at it as "Other" as a file and "Linux" as a file..
here's the fix
scp Other\ Linux\ 2.6.x\ kernel-cl1.vmdk root@192.168.0.1:"Other\ Linux\ 2.6.x\ kernel-cl1.vmdk"
root@192.168.0.1's password:
Other Linux 2.6.x kernel-cl1.vmdk 100% 2043MB 10.9MB/s 03:07
you can also leave out the escape characters in the source files and just put the source file in quotes, but you'll need them on the destination file.
scp "Other Linux 2.6.x kernel-cl1.vmdk" root@192.168.0.1:"Other\ Linux\ 2.6.x\ kernel-cl1.vmdk"
root@192.168.0.1's password:
Other Linux 2.6.x kernel-cl1.vmdk 100% 2043MB 10.9MB/s 03:07
hope that helps someone :-)
8 comments:
Helped me ;) Thanks!
Helped me too! Thanks!
Very good one. Many thanks!
Thanks for this. I was so convinced that my ssh config was the problem, but it was just the spaces.
Thanks, fixed my problem
Thanks - that one was driving me crazy.
Perfect - thanks!
Awesome. Thank you. I was going nuts!
Post a Comment