I'm using the command scp -P${myport} ${username}@${ip} to tranfer the files, but I don't know how to write the filepath in windows.
For example, if the filepath in windows isC:/Download, how to write the scp command?
1 Answer
If we talking about the new feature of the latest Windows build: OpenSSH in Windows, you just need to quote the Windows path, because it usually contains colon sign :, that in general is used to indicate the remote host within scp, rsync, etc.
So to copy a file from (local)Ubuntu to (remote)Window you can use a command as:
scp ./test.txt user@windows-host:'D:\Downloads\'To copy a file from (remote)Window to (local)Ubuntu you need to add the option -T (explanation) then the command will look as:
scp -T user@windows-host:'D:\Downloads\test.txt' ./ scp -T user@windows-host:'D:\Downloads\*.*' ./ 1