Brad Stewart

Copying Files Between Windows and Linux using PuTTY

Discussion created by Brad Stewart Employee on Jul 8, 2010
Latest reply on Jun 23, 2014 by Zasil Medina

Here's a neat way to transfer files between your Windows PC and your Linux (Ubuntu) project using Ethernet.


PuTTY is a program that connects one device to another over the network.  It supports SSH and Telnet, among others. 


PuTTY is a “client” application that talks to a “host”.  The host must be running an SSH server (which is often the case for iMX Linux enabled systems).


A Windows version exists and this is ideal for transferring files between your Windows PC and a Linux Platform.


Download PuTTY here:  http://www.chiark.greenend.org.uk/~sgtatham/putty/


Select the Windows Installer version.  This installs the programs and help files you will need.


File transfers can be done using PSCP (Putty Secure CoPy) or by using PSFTP (Putty Secure File Transfer Protocol). 


PSFTP can be launched from the Windows Start.


PSCP must be launched from within a DOS box (StartWingdings"">àRun and enter cmd, then press OK).  Before
running PSCP, you need to set the path variable.  At the DOS command prompt, type


set PATH=C:\Program Files\PuTTY


This assumes you installed PuTTY in C:\Program Files\PuTTY (default).  Note the “\” slash.   


This will only work for the lifetime of that particular console window. To set your PATH more permanently on Windows NT, 2000, and XP, use the Advanced tab of the System Control Panel (right-click on MyComputer then select Properties).  Click the Environment Variables button, high-light “path” and edit it.  Add “;C:\Program Files\PuTTY” at the end of
the line.  You can then verify the path is correct by typing “path” at the DOS prompt.


The format for pscp is straight forward:


pscp [options] source destination


To copy a Windows file to Linux system, at the DOS prompt, type


pscp c:/music.mp3  ubuntu@10.0.0.3:/home/ubuntu/Music


which will copy the file music.mp3 to my Music folder into Linux.  My Ubuntu EVK has an ip address as 10.0.0.3.  (Note that you can use either / or \ for the Windows files and directories, but you must use / when specifying the Linux files.)


The reverse works as well (copy Linux file to Windows)


            pscp ubuntu@10.0.0.3:/home/ubuntu/Music/music.mp3 c:/


This copies the music.mp3 file from Linux into my C root directory.


There are many other options available, including the ability to use the ftp protocol as well.  See the help file for more information.


Outcomes