从Windows复制到Linux而不复制整个路径

时间:2018-10-29 17:44:50

标签: powershell amazon-ec2 cygwin scp

我正在使用Cygwin将本地Windows文件夹中的所有文件复制到powershell内的EC2 linux实例。当我尝试复制文件夹中的所有文件时,它将路径名复制为文件夹:

\cygwin64\bin\scp.exe -i "C:\cygwin64\home\Ken\ken-key-pair.pem" -vr \git\configs\configs_test\ ec2-user@ec2-22-75-189-18.compute-1.amazonaws.com:/var/www/html/temp4configs/

将复制正确的文件,但以Windows格式错误地包含以下路径:

/var/www/html/temp4configs/\git\configs\configs_test/file.php

我在没有-r的文件夹之后尝试了一个星号,例如:

\cygwin64\bin\scp.exe -i "C:\cygwin64\home\Ken\ken-key-pair.pem" -v \git\configs\configs_test\* ec2-user@ec2-22-75-189-18.compute-1.amazonaws.com:/var/www/html/temp4configs/

但是会返回诸如

的错误

“ gitconfigsconfigs_test *:无此类文件或目录”

我该怎么做而不复制路径来复制文件?

谢谢

1 个答案:

答案 0 :(得分:2)

在使用cygwin程序时,使用POSIX Path更安全,并且大多数时间是唯一的方法。要从Windows到posix PATH进行隐蔽,请使用 TableColumn<Tuple, String> textColumn= new TableColumn<>(); textColumn.setText(column.getName()); textColumn.setMinWidth(column.getWidth()); textColumn.setEditable(true);

cygpath

使用Windows,将导致服务器误解客户端请求