How to Copy Files from a Linux Server to Windows

Photo of author

By Victor Ashiedu

Published

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.

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.

How to Copy Files from a Linux Server to Windows

Here are the steps.

  1. 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.

Note the difference in how the full path is specified in Linux, compared to Windows. In Linux, we typically use the forward slash (/) to separate paths while on Windows, we use Backslash (\). Although we could use / in Windows, it is not common.
  1. 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!
transfer files from Linux Server to Windows

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.

About the Author

Photo of author

Victor Ashiedu

Victor is the founder of InfoPress Media, publishers of Ilifeguides and Itechguides. With 20+ years of experience in IT infrastructure, his expertise spans Windows, Linux, and DevOps. Explore his contributions on Itechguides.com for insightful how-to guides and product reviews.

Related Articles

Get in Touch

We're committed to writing accurate content that informs and educates. To learn more, read our Content Writing Policy, Content Review Policy, Anti-plagiarism Policy, and About Us.

However, if this content does not meet your expectations, kindly reach out to us through one of the following means:

  1. Respond to "Was this page helpful?" above
  2. Leave a comment with the "Leave a Comment" form below
  3. Email us at [email protected] or via the Contact Us page.

Leave a comment

Send this to a friend