scp 复制远程文件 文件带空格 处理

我使用到的是从远程的服务器上面下载文件到本地

语法 scp user@host:filepath local_direction_path

我有遇到一个问题 文件包含空格 转义也没有用google 一下出来了答案

scp 'user@host:file_dir/"the part contains whitespace"' localdirection

scp user@host:file_dir/'"the part contains whitespace"' localdirection

scp user@host:file_dir/"the part contains whitespace" localdirection

scp user@host:file_dir/"'the part contains whitespace'" localdirection

或者

scp user@host:file_dir/the\ part\ contains\ whitespace localdirection

注意是三个反斜杠

慢慢沉淀自己
原文地址:https://www.cnblogs.com/martinding/p/7506161.html