Today, many people use PC with both Linux and Windows operating systems. Both play an essential role in their way. However, the real hassle is copying files between the two operating systems. It is quite a challenging task that can become easy with the right tools. With the correct means, you can quickly transfer files from Linux to Windows and vice-versa. Here are some of the most common and easy tools you can use to transfer files from Linux to Windows.
Methods to transfer files from Linux to Windows
Method 1: Using SMB
The SMB (Server Message Block) protocol is a client-server communication protocol built into most Linux PCs. It requires you to connect both the PCs for one time and can later use to share files to and from the two operating systems. Following are the steps to transferring files from Linux to Windows PC using SMB protocol.
In your Windows system, locate the folder you want to share.
Right-click and choose give access to > specific people.
Now, click on the share button and press done on the following screen.
In the next step, press Win+R, type cmd, and then press Enter.
Now, type ipconfig and press Enter. Note down the IPv4 address of the first adapter on the list.
Now start your Linux system, launch the File Browser and then click on + Other Locations.
In the connect to server field, enter the IP address mentioned in Step 5 in the below-mentioned format.
smb://IP
Enter your Windows account credentials at the authentication window and press Connect.
Now you can transfer files between Linux and Windows using this folder.
Method 2: Using SSH
SSH or Secure Shell Protocol is a secretive network protocol commonly used for remote login. This method requires an SSH client such as PuTTY to transfer files from Linux to Windows and vice versa through a command Line. Following are the steps to follow for sharing files using SSH.
- Download and install PuTTY on the Windows system.
- Launch the terminal on the Linux system by pressing CTRL + Alt + T.
- To establish and enable SSH on Debian-based Linux systems like Ubuntu, enter the command:
“sudo apt install ssh” and then
“sudo systemctl enable ssh – now”
4. However, on other Linux systems like RedHat, CentOS, Fedora, and others, use the command:
“sudo apt install OpenSSH” and then
“sudo systemctl enable sshd – now”
5. If the firewall is blocking you, use the command:
“sudo ufw allow22/tcp”
6. Now, enter the IP address and note it down as well.
7. Now start the Windows system, open Command Prompt, and use the below-mentioned commands as appropriate.
To copy a single file named doc.txt from a remote Linux system to the D drive of the Windows system, enter the command:
“pscp user@host:remote_path/file_name host_path\file_name”
For copying all the files from the folder, enter the command:
“pscp user@host:remote_path/*host_path\”
For instance, for copying a test folder from a person named Anup’s PC, you must enter the command:
“pscp anup@192.168.10.65:/home/anup/Desktop/naya/* D:\testfolder\”
For copying all files and folders in a folder, enter the command:
“pscp -r user@host:remote_path/ host_path\”
For instance, copying all files and folders of Anup’s folder into the test folder, enter the command:
“pscp -r anup@192.168.10.65:/home/anup/Desktop/naya D:\testfolder\”
Method 3: Using SFTP
Besides the two server system network methods, you can also use a third-party tool like FileZilla that transfers files using SFTP or SSH File Transfer Protocol. To learn to share files using this method, follow the steps mentioned below:
Follow Steps 1 – 6 from the section above on the Linux system to set up SSH.
Open the Windows system and launch FileZilla. Now select File>Site Manager>New Site.
Select SSH File Transfer Protocol (SFTP) in the protocol field.
Enter the Linux IP Address in the host field from step 6 of method 2.
Enter the login credentials of the Linux system and press Connect.
Enable the Always trust this host option and press OK if the PC prompts.
Once the connection is made, you can transfer files between the two operating systems either via drag and drop or right-clicking the file and selecting the upload/download option.
Conclusion
Transferring files from Linux to Windows is a bit intimidating at first. But after establishing a connection, it becomes easier. After all, to enjoy the benefits of both operating systems, you must go through some small challenges. In the end, you get to learn something new and always end up in a win-win situation.
Experiencing difficulties with your Device, check out our “How To” page on how to resolve some of these issues.