Monday, May 24, 2010

Easily transfer files between Linux and Windows systems

Some like me work across multiple platforms like Linux and Windows operating systems. Some times, it becomes easier on one platform to perform certain functions on some files and then move it to the required platform rather than struggling there.

For example, some would prefer to edit the source code on Windows systems using some Windows specific editors rather than in Linux. To move the files across the systems, normally one would either use Samba based network mapping or a FTP server or any other method. But, for some with command line fu skills, SCP is god sent. This method only covers execution of the commands on Windows systems. (i.e., Windows will be host for the to and fro transfer of the files).

Enable SSH on the Linux box, get Putty utilities on the windows system.

Add the putty utilities to the path and create a small batch file for copying from Windows system to Linux system with the following command.

Say, name the batch file as CPF.BAT

@pscp -pw %1 @:/home/

Now, you can copy files from Windows system to the Linux system using the following command.

The file will be copied to the directory under the credentials.

Similarly to copy from the Linux to Windows, use the same command. Explore the command and parameterise whatever you need, like the destination directory Etc,.

No comments:

Post a Comment