Copy files from windows to linux

Copy Files Between Windows and Linux Using Command Line

It is not always that you will  need to copy a file from windows to Linux or vice versa. But at times when you are automating things or trying to achieve some copy functionality using a script, it is good to have a utility to  do that. Here is where  pscp comes into play. Using pscp you can copy file to/from windows and Linux. In this guide, I will go through the steps in doing the same.

Copy File from Windows To Linux

1. Download pscp.exe from here

2. copy the pscp.exe executable to the system32 directory of your windows machine. This folder normally exists in C:\Windows\System32 path.

3. Open PowerShell and use the following command to verify if pscp is accessible from the path.

4. Use the following format to copy the file to Linux box.

  1. -pw for the password.
  2. replace password with the Linux user password.
  3. C:\Users\Admin\Desktop\test.txt represents the path of the file that has to be copied to the Linux system.
  4. is the IP of the Linux server.
  5. /home/vagrant is the user accessible path in the Linux system to copy the file.

If you are using private keys for authentications, you can use -i flag instead of -pw followed by the path to the .ppk file. If your key file is in pem format, you can use the puttygen command to convert it to ppk.

Info: Learn Linux & Windows administration from Pluralsight with its 10 days free account

For key based authentication, the command looks like below.

Copy File Form Linux To Windows

You can use pscp to copy files from Linux to windows. use the following command format for the same.

The above command will copy the file in Linux from the specified path to the windows desktop.


In one of my websites, I did a bulk import from a CSV. Unfortunately, the bulk import created a lot of duplicated…

Read more
Teachable Review and Coupon code

Making money online is a dream that most of the people see these days. Be it through writing, blogging or any other…

Read more
How to Earn Extra/Passive Income as a Techie - Beginners Guide

There is a famous saying by Dr. APJ Abdul Kalam, "Love your job not your company, because you may not know when your…

Read more

Cloud Computing Tutorial Blog