Mac OS X上的scp问题:scp不喜欢文件名中的空格,"\"修复不起作用 [英] Problem with scp on Mac OS X: scp doesn't like spaces in filenames, "\" fix doesn't work

查看:362
本文介绍了Mac OS X上的scp问题:scp不喜欢文件名中的空格,"\"修复不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用scp在两台Mac(OS 10.6.8)之间传输文件.但是它失败了,因为我的目录/文件名中有空格.我无法更改目录/文件名.

I am trying to use scp to transfer files between two Macs (OS 10.6.8). But it fails because there are spaces in my directory/file names. I can't change the directory/file names.

在Mac终端中使用空格时,经常使用\符号.但是,在这种情况下,它不起作用.我非常感谢有关如何处理此问题的任何提示.谢谢.

I have often used a \ symbol when working in a terminal with my Macs to represent spaces. In this case, however, it is not working. I would very much appreciate any tips on how to deal with this. Thanks.

这是我正在做的一个例子,以防万一我在某个地方犯了一个愚蠢的错误:

Here is an example of what I'm doing, in case I'm making a silly mistake somewhere:

scp -r me@myWork:../../My\ documents/Projects/Project\ 1/* ./Desktop

Error: scp: ../../My: No such file or directory

我也尝试过rsync,但也不起作用:

I tried rsync too and that doesn't work either:

rsync -avub -e ssh me@myWork::../../My\ documents/Projects/Project\ 1/* ./Desktop

rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-40/rsync/io.c(452)

推荐答案

您没有逃过我"之后的空格.这个:

You didn't escape the space after "my". This:

me@myWork:../../My documents/Projects/Project\ 1/*

应为:

me@myWork:../../My\ documents/Projects/Project\ 1/*

或者您可以将整个路径都用引号引起来.

Or you could just wrap the entire path in quotes.

这篇关于Mac OS X上的scp问题:scp不喜欢文件名中的空格,"\"修复不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆