scp is a great tool. Built to run over ssh it maintains a good unix design. It does however cause a few problems with it's nonchalant handling of file names.
For example, transferring a file which has a space in the name causes problems because of the amount of escaping required to get the space to persist on the remote side of the connection.
Copying files from local to remote is easy enough, just quote or escape the file name using your shell.
scp Test\ File remote:
scp 'Test File' remote:
scp "Test File" remote:
Copying files from remote to local can be more tricky
scp remtote:Test\ File .
scp: Test: No such file or directory
scp: File: No such file or directory
scp stimulus:"Test File" .
scp: Test: No such file or directory
scp: File: No such file or directory
scp "stimulus:Test File" .
scp: Test: No such file or directory
scp: File: No such file or directory
The escaping is working on your local machine but the remote is still splitting the name at the space.
To solve that, we need an extra level of escape, one for the remote server. Remember that your shell will eat the \ so you need a double \\ to send it to the remote
scp remote:Test\\\ File .
Test File 100% 0 0.0KB/s 00:00
You can also combine the remote escape with local quoting
scp remote:"Test\ File" .
or
scp "remote:Test\ File" .
Best solution of all, avoid spaces in file names. If you can't avoid it, I find the easiest solution is to replace ' ' with '\\\ '.
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteI hope there will be more of this type of publication.Tessa
ReplyDeleteThe article you have shared here very awesome. I really like and appreciated your work. I read deeply your article, the points you have mentioned in this article are useful minecraft
ReplyDeleteI saw the some reference online but I don't understand perfectly, can any one help on this?
ReplyDeletemost fun games 69
What an interesting post to read. I learned new information from your article, you are doing a great job.
ReplyDeleteKeep it Up!
Certificationdeal
Thanks For Sharing Such a Nice Article`
ReplyDeletekeep up the good Work
Metro Taxi Tunbridge Wells
Crown Taxi Tunbridge Wells
What an interesting post to read
ReplyDeletethanks and Keep up the good work.
Best homeopathic doctor in Pakistan
WONDERFUL Post.thanks for share..more wait..
ReplyDeleteForum.ppr.pl
Information
Click Here
Visit Web
ندرك جيدًا ان نقل العفش يعتبر من أهم الأمور التي يجب التركيز عليها؛ لهذا السبب فإنه يجب أن يتم التأكد من سلامته عند النقل فتقدم لكم شركتنا خدمات نقل العفش باحترافية بدون خدش
ReplyDeleteشركة نقل عفش بالرياض
ان الحمام يتكاثر وجوده في فصل الشتاء و في فصل الصيف مما يجعلنا في حاجة إلى مكافحتة لذلك يتم تركيب طارد حمام مع افضل شركات تنظيف مخلفات الحمام والطيور وتركيب أفضل أنواع شبك طوارد الحمام
شركة مكافحة الحمام بالرياض
تمثل المكيفات دور هام في حياتنا في اشهر الصيف
شركة خبراء الرياض تقدم خدمات تركيب المكيفات بالادوات الخاصة للمكيف مع ارخص الاسعار وعمالة مدربة ومتخصصون في هذا المجال
شركة تركيب مكيفات بالرياض
I was very pleased to find this web-site. I wanted to thanks for your time for this wonderful read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you blog post.
ReplyDeleteHabotao.com
Information
Click Here
Visit Web
The next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought you have something interesting to say. All I hear is a bunch of whining about something that you could fix if you werent too busy looking for attention.
ReplyDeletePlayer.me
Information
Click Here
Visit Web
Amazing post, thanks for sharing this article. Really Enjoyed Alot Thanks for Sharing
ReplyDeleteReading Taxi Service
Your Blog is very informative .wish to see much more like this. Thanks for sharing.
ReplyDeleteCrown Taxi Tunbridge Wells
Really nice and helpful Article. Thanks For Sharing
ReplyDeleteMetro Taxi Tunbridge Wells
Nice Article, waiting for your another
ReplyDeleteSky Taxi Tunbridge Wells
.
ReplyDeleteكنبة الوضعيات
كرسي مكتب مريح
كنبة المتزوجين
ساعات رجاليه
نظارات شمسية رجالي
سبرديلة للبنات
كرسي اطفال سيارة
كرسي استرخاء رخيص
كرسي مساج كهربائي
I find this post so interesting. Keep us updated! Click here
ReplyDelete