- How to copy file from linux to windows [closed]
- 1 Answer 1
- How To Transfer File From Linux To Windows
- Ways to Transfer Files between Linux and Windows
- Transfer Files Using SMB
- Transfer Files Using SSH
- Transfer Files Using SFTP
- How to Transfer File from Linux to Windows VM?
- How to Copy Files from Linux to Windows
- Install SSH Server:
- Install Samba Tool:
- From Windows to Linux:
- From Linux to Windows:
- Conclusion:
- About the author
- Omar Farooq
How to copy file from linux to windows [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Anyone please help me how to copy files from Linux command prompt to windows. I am connecting to Linux system using putty in windows system
1 Answer 1
Before you can start your transfer you should be following the below steps:
- Setup your Linux sever for SSH access.
- Install Putty on Windows machine.
- The Putty-GUI can be used to SSH-connect to your Linux Box, but for file- transfer, we just need one of the putty tools called PSCP
- With Putty installed, set Putty’s path so that PSCP can be called from DOS command line.
- Putty is installed with default settings (in C-drive).If you install Putty in some other DIR, please modify the below commands accordingly.
- Now on Windows DOS command prompt: a) set the path from Windows Dos command line(windows): type this command: set PATH=C:\Program Files\PuTTY b) check / verify if PSCP is working from DOS command prompt: type this command: pscp
The copy command should be something like below:
pscp.exe linux-username@linux-server-ipaddress: [source-DIR-inLinux] [destination-DIR-inWin]
How To Transfer File From Linux To Windows
Copying files in Windows or Linux is simple enough. Copying files between them, though, not so much. The classic copy-paste with a USB stick method does work, but it’s not very efficient.
Instead, you can transfer files using protocols like SMB and SSH and using FTP applications such as FileZilla. We’ve listed step-by-step instructions for these and more methods in the sections below.
Ways to Transfer Files between Linux and Windows
Before you start, do keep in mind that, unlike Windows, Linux is case-sensitive. When entering the commands or file paths, users often forget this and can’t figure out why the file transfer doesn’t work despite following the steps correctly.
With that said, here are the various ways to transfer files between Linux and Windows.
Transfer Files Using SMB
The Server Message Block (SMB) protocol is a client-server communication protocol built into most Linux distributions. Here are the steps to transfer files using SMB:
- On your Windows system, locate the folder you’re trying to share.
- Right-click the folder and select Give access to > Specific People.
- Click on Share and press Done on the next screen.
- Next, press Win + R, type cmd , and press Enter.
- Type ipconfig and press Enter. Note the IPv4 address of the first adapter on the list.
- On the Linux system, launch the File Browser and click on + Other Locations.
- In the Connect to Server field, enter the IP from Step 5 in the following format:
smb://IP
Transfer Files Using SSH
Secure Shell Protocol (SSH) is a cryptographic network protocol commonly used for remote login. With an SSH client such as PuTTY, you can transfer files between Linux and Windows via the command line. Here are the steps to do so:
- On the Windows system, download and install PuTTY if you haven’t already.
- On the Linux system, press CTRL + Alt + T to launch the Terminal.
- Install and enable SSH with the following commands on Debian-based Linux systems such as Ubuntu:
sudo apt install ssh
sudo systemctl enable ssh —now - On RedHat, CentOS, Fedora, and other systems, use these commands instead:
sudo apt install OpenSSH
sudo systemctl enable sshd —now - In case you’re getting blocked by the firewall, use the following command:
sudo ufw allow 22/tcp - Enter ip addr and note the IP Address.
pscp user@host:remote_path/file_name host_path\file_name
pscp user@host:remote_path/* host_path\
eg: pscp anup@192.168.10.65:/home/anup/Desktop/naya/* D:\testfolder\
pscp -r user@host:remote_path/ host_path\
eg: pscp -r anup@192.168.10.65:/home/anup/Desktop/naya D:\testfolder\
Transfer Files Using SFTP
You can also use a third-party tool such as FileZilla to transfer files using SFTP (SSH File Transfer Protocol). Here are the steps to do so:
- On the Linux system, follow Steps 1 – 6 from the section above to set up SSH.
- On the Windows system, launch FileZilla and select File > Site Manager > New Site.
- In the Protocol field, select SFTP – SSH File Transfer Protocol.
- In the Host field, enter the Linux IP Address from Step 6 of the section above.
- Fill in the login credentials of your Linux system and press Connect.
- If prompted, enable the Always trust this host option and press OK.
- Now that the connection is established, you can transfer files between Windows and Linux by dragging and dropping or right-clicking the file and selecting Upload/Download.
How to Transfer File from Linux to Windows VM?
You can easily transfer files from Linux to a Windows VM using a USB Stick. Of course, that’s just one easy method. We have an article that details multiple ways to transfer the files for your further reading.
Anup Thapa primarily covers Windows systems, networking, and computer hardware at TechNewsToday. Anup has been writing professionally for almost 5 years, and tinkering with PCs for much longer. His love for all things tech started when he got his first PC over 15 years ago. It was a Pentium IV system running Windows XP on a single 256 MB stick. He spent his formative years glued to this PC, troubleshooting any hardware or software problems he encountered by himself. Professionally, Anup has had brief forays into a variety of fields from coding and hardware installation to writing. In doing so, he’s worked with people of different backgrounds and skill levels, from average joes to industry leaders and experts. This has given him not just a versatile skill set, but also a unique perspective for writing that enables him to concisely communicate complex information and solve his reader’s problems efficiently. You can reach out to him at anup@technewstoday.com.
How to Copy Files from Linux to Windows
You may have copied numerous files and directories from one location to another within a single operating system. Have you ever attempted copying a file from one operating system to another? If you have tried, you’ve most likely failed. This guide will demonstrate how to copy a file from one operating system to another. Within this article, we will be discussing a unique and straightforward method to transfer or make a duplicate of a file/folder from Linux to Windows or vice versa. So, you need to update your system first. For updation, try to use the “apt” package within the update instruction with sudo rights. Add your sudo account password, and the system will get updated in a few seconds.
After a successful update, upgrade your system if it is required. Use the below-shown upgrade command using the “apt” package.
Install SSH Server:
Within some cases, we may require the ssh-server to transfer files between two different operating systems, i.e., Linux and windows. Therefore, we need first to install an ssh server on our Ubuntu 20.04 system. For installation, use the below-shown “apt” command.
Tap “y” upon being asked to continue the installation of ssh-server on your system.
To check whether the ssh service is currently active and enabled on our Linux operating system or not, you have to use the systemctl instruction in the shell. Use the word “status” at the last of this instruction. The output shows that the service is currently active on our system.
Install Samba Tool:
You must first ensure that the “samba” tool is installed on your machine before using any approach. If not, try using the apt installation command below with the name “samba.” Add your sudo account password, and the execution will be started.
Tap “y” to continue installing and processing the “samba” package on our Ubuntu 20.04 Linux operating system.
After its successful installation, you have to create a samba user, i.e., “test” using the usermod instruction. After that, add the smbpasswd command on the shell to create a password for this account. Add password on asked one after another as shown below.2
From Windows to Linux:
Before going up with the copy files between Linux and Windows systems, you need to find out the ip address of the Windows operating system. To find out the ip address, open your windows command prompt application and execute the “ipconfig” command on it. It will display the different WLAN settings of your windows system. The first adapter WLAN setting will show you your system’s “ip address.” Note it down for now.
Now, within the windows “Local Disk©” directory, you have to create a new folder to be shared. As you can see from the image beneath, we have named “Share.” We need to update the privileges of this folder to allow remote users access. So, right-click on it and hover over the “Give access to” option. It will expand further, and you have to select the “Specific people..” option, as per the below-shown output image.
The below screen “Network access” will be opened. As there is only one owner of this folder right now, you have to add a new user here.
So, we have added the user “Everyone” and assigned it to read/write privileges for this folder. Tap on the “Share” button to continue applying the changes.
Your folder is now shared, and anyone can access it. You can also see the file path shown in the below image. Tap on the “Done” button to exit.
Open the file explorer within the Ubuntu 20.04 system and tap on the “Other locations.” You will check the “Connect to server” option at the bottom of the screen. At the text bar, write the simple URL command of the format shown below to get the shared file from the Windows system. Tap on the “Connect” button to do so.
A dialogue shown below will appear. You have to add a registered user’s name, domain name, and password for the Ubuntu 20.04 system. Tap on the connect button after that.
The folder “Share” from the windows system will be opened in your Ubuntu 20.04 system, as shown below. We have added a new text file from our Ubuntu system to this folder.
On checking the Windows “Share” folder, we have got to know that the file from Ubuntu’s “Share” folder is also here, as demonstrated below.
From Linux to Windows:
To copy a file from Linux to windows, you have to create a new folder, i.e., “Share,” in the home directory, as shown below. Right-click on it and tap on “Properties.”
Expand the ” Local Network Share ” section within the Properties dialogue that appeared on your screen, expand the “Local Network Share” section. Check to mark the “Share this Folder” option and the “Allow others to create and delete” option. Tap on the below “Share” button and close it.
Now, your folder has a “share” sign on it.
Open the “run” application in windows and run the IP address URL with a double backslash sign, i.e.,//ip-address. The “Share” folder will be opened on your Windows “Network” file explorer.
Conclusion:
This was all about transferring or copying a file from Linux to the Windows operating system. For more clearance, we have tried to copy the file from Windows to Linux first. We have used the Ubuntu 20.04 Linux operating system and Windows 10 to copy files. All steps elaborated in this article will be helpful for all types of users.
About the author
Omar Farooq
Hello Readers, I am Omar and I have been writing technical articles from last decade. You can check out my writing pieces.