Copy file from windows to linux in commandline

FAQ

In this article we will discuss on how to copy file from Linux to windows or vice versa using different tools. The discussion will be around using some GUI to copy the files and through CUI or command line to complete the same copy tasks.

GUI Mode:

For GUI mode you can download winscp tool. If you are interested for more info then head over to winscp installation guide

CUI Mode:

From Unix to Unix:

For command line or CUI mode you can use scp commands as seen here

From Unix to Windows and vice versa:

Copying a file or folder from windows to Linux using command line can be done using a tool called pscp which has inline password option for authentication. This means you can use the same command inside a shell script or batch script and schedule a copy of files or folders time to time unattended. you can download pscp from here and here.

Examples:

Example command to copy file from Linux to Windows with inline password :

Linux From DIR :/root/second/*
Windows To DIR : C:/Users/joe.doe/Downloads (Forward slashes only)
-pw : Password

pscp -pw mysecretpassword root@vmidelapanserver01:/root/second/* C:/Users/joe.doe/Downloads

Example command to copy file from windows to Linux with inline password:

pscp -pw mysecretpassword C:\Users\Admin\Desktop\* root@vmidelapanserver01:/home/Admin/

Example Output:

copy file from windows to linux

In case of any ©Copyright or missing credits issue please check CopyRights page for faster resolutions.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.