如何在 Linux 中为 scp 副本转义路径中的空格? [英] How do I escape spaces in path for scp copy in Linux?

查看:66
本文介绍了如何在 Linux 中为 scp 副本转义路径中的空格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 linux 新手,我想将文件从远程系统复制到本地系统...现在我在 linux 系统中使用 scp 命令...我有一些文件夹或文件名带有空格,当我尝试时要复制该文件,它会显示错误消息:没有这样的文件或目录"

I'm new to linux, I want to copy a file from remote to local system... now I'm using scp command in linux system.. I have some folders or files names are with spaces, when I try to copy that file, it shows the error message: "No such file or directory"

我试过了:

scp ael5105@192.168.0.200:'/home/5105/test/gg/Untitled Folder/a/qy.jpg' /var/www/try/

我在网上看到了一些参考资料,但我不太明白,有人可以帮忙吗?

I saw the some reference online but I don't understand perfectly, can any one help on this?

如何在复制过程中对文件名或目录名中的空格进行转义...

how can I escape spaces in file name or directory names during copying...

推荐答案

基本上你需要转义它两次,因为它在本地转义,然后在远程端转义.

Basically you need to escape it twice, because it's escaped locally and then on the remote end.

您可以执行以下几个选项(在 bash 中):

There are a couple of options you can do (in bash):

scp user@example.com:"'web/tmp/Master File 18 10 13.xls'" .
scp user@example.com:"web/tmp/Master File 18 10 13.xls" .
scp user@example.com:web/tmp/Master\ File\ 18\ 10\ 13.xls .

这篇关于如何在 Linux 中为 scp 副本转义路径中的空格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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