Glam Prestige Journal

Bright entertainment trends with youth appeal.

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?

7

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy