How can I copy a file/folder from windows to linux (putty), probably using scp command?
I used scp user@hostname(windows):c:\folder\filname user@hostname(Linux):/folder/filename(destination), but unfotunately I got an error.
Basically, I am trying to copy from windows to Linux. Hope it works whether I am on windows or Linux.
I don't think this can work in this form, with the backslash \
separators:
scp user@hotname:c:\folder\filname user@hostname:\folder\filename(destination)
First of all, the path separator in Linux is /
instead of \
, so this would be better:
scp user@hotname:c:\folder\filname user@hostname:/folder/filename
Secondly, your command looks like as if you're running this command on a third PC, on machineC to copy files from machineA to machineB. If this is not the case and you are in fact on machineA copying files to machineB, then this would be better:
scp c:\folder\filname user@hostname:/folder/filename
UPDATE
If you don't have the scp
command in Windows, here are a few options:
scp
toopscp.exe
instead of scp
, the above syntax will work.In *nix systems, this should work:
# to copy file.ext from remote server to current working directory
# note the dot (.) at the end, which means current directory
$ scp [email protected]:~/desired/folder/file.ext .
# to copy all files in a folder from remote server
# to current directory
# note the dot (.) at the end, which means current directory
$ scp -r [email protected]:~/desired/folder/* .
# copy a folder and all its contents as it is from remote server
# to current directory
# note the dot (.) at the end, which means current directory
$ scp -r [email protected]:~/dersired/folder .
More information can also be found in this article: scp command syntax
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With