Do you need to copy files from a Linux Server to a Windows PC and wondering how? It is pretty straightforward and this quick guide shows how to do that.
Before you proceed with the steps below, ensure that SSH is installed on the Linux Server. Also, port 22 must be opened on the Linux Server and accessible from the Windows PC or Server you are copying files into.
Full Steps
In the steps below, I will copy files – myfile.yaml and myscript.sh – from my Ubuntu Linux VM to my Windows laptop – c:\temp folder.
Here are the steps.
- On the Windows PC or Server, open CMD or PowerShell. Then, run the SCP (Secure Copy) command similar to the one below. I have explained the arguments in the command below.
SCP [email protected]:~/\{myfile.yaml,myscript.sh\} c:\temp\
The IP address of the Ubuntu Linux box is 192.168.126.20 while my username on the server is victoradmin. Replace these with your details.
After the server’s IP address (or hostname), there is a colon (:). This is required, otherwise, the command may fail.
Finally, you specify the full paths to the files or folders you want to transfer from the Linux Server to your Windows computer. The last bit worth mentioning is the way I specified multiple files on the path using the brace expression, ‘{myfile.yaml,myscript.sh}’.
For this example, I am copying files from my Linux home folder (specified using the tilde “~” symbol). After entering the full paths to the files you’re copying from the Linux box, the final bit is to enter the path you’re pasting them on the Windows computer.
For this example, I’m pasting the files on the c:\temp folder.
- Now, let’s run the command. When you do so, Windows will prompt you for the password of the Linux account. In my case, the password for victoradmin.
Enter the password and press the enter key. The files will be copied from the Linux Server to the Windows PC!
That is it!
If you have a question about moving files from Linux to Windows or have a question, use the Comment form at the end of this page.
Alternatively, you can respond to the “Was this page helpful?” question below.