How to copy files between a PC and a Raspberry Pi

Although we can access its content using third-party applications or through the command line using WSL, if we don’t want to spend time installing applications or using the command line, we should use the exFAT file system.

The exFAT file system is compatible with both Windows and Linux and macOS, so we can connect it to any device regardless of its operating system to access, copy and modify its content once we have formatted the unit that we are going to use with the exFAT file system.

Once we connect the unit to the Raspberry Pi to copy the data that we want to take to the PC, it will be mounted automatically and we can start copying the data using the graphical interface of Raspberry OS clicking on the folder icon located at the top of the interface.

Next, we select the content that we want to transfer, with the right mouse button click on Copy and go to the unit that we have connected to paste the content.

via SSH

If we do not want to use an external hard drive or a USB stick, we can use SSH to transfer data from the Raspberry Pi to the PC with Windows using the Secure Copy Protocol (scp) command. The first thing we need to know is the IP of the Windows computer where we are going to copy the data. We can easily find out through the command line using:

ipconfig

IP PC Windows

If we are using the Wi-Fi connection, we must write down the number that appears in the Wireless LAN Adapter section, within the IPv4 Address section.

Next, we go to the directory where the files that we want to transfer to the PC are stored and use the following command

scp pi@ipdelpcconwindows:nombre-archivo.extensión

For example, if the IP of the Windows PC is 192.168.0.97 and the file name is rosename.mkv, the command to use is:

scp pi@192.168.0.97:elnombredelarosa.mkv

Via FTP

If we usually find ourselves in the situation of copying files between the Raspberry Pi and a PC with Windows or another operating system, the best thing we can do is use the protocolo FTPwhich offers support for SFTP that allows us to send files securely between devices.

One of the best applications of this type, which is also open source, free and includes a large number of functions is FileZilla, an application that we can download for Windows through the following link. Downloading the normal version is more than enough since it offers SFTP support.

Once we have installed the application on the PC, first of all, we must know the local IP that the Raspberry is using, information that we can know using the following command from terminal:

ipconfig

This is the same command that we can also use in Windows to find out the local IP of the computer. After finding out the local IP of the Raspberry Pi, we open FileZilla and create a new connection in which we must write the IP that we have noted in serverin encryption select SFTP, en User pi and in Cpassword the password that we have set. Finally, we click on Connect and navigate through the directory of the PC and the Rasberry Pi until we find the files that we want to share in both directions.

FileZilla general site control

With a cloud storage platform

If our needs are to send files that take up very little space, it is not necessary to resort to some of the methods that we have shown you above, since it is intended to transfer large files and a large number of files.

We can use any cloud storage platform where we have more than enough space to upload the files we want to share with a PC. We can also use this method to copy files on a PC and a Raspberry Pi.

via email

Raspberry Pi OS includes an email manager, a manager that offers us many functions, but it is more than enough to send email files between a PC and a Raspberry Pi and vice versa. We just have to use the option Attach files to include the files we want to share, as long as they take up little space.

The mail client included in the Raspberry Pi allows us to configure both Gmail and Outlook / Hotmail accounts in seconds, we just need to know the account name and password. The application takes care of doing the rest.

Methods not recommended

Although initially using the SD card seems like the easiest and fastest method to transfer files between a Raspberry and a PC, it is the least advisable to use. We should only consider the possibility of using it if none of the methods that we have shown you above have worked.

The SD card of a Raspberry includes a partition where the files are stored. boot data. If we modify any boot file, the system will stop working and we will be forced to install it from scratch. Also, it is necessary to turn off the device before extracting the data, so we will not be able to transfer the data quickly between both devices while they are running.

The last reason not to recommend the use of the SD card is that it can be easily damage if we use it regularly to transfer information from the device to a PC or vice versa. All the methods that we have shown you in this article are very simple and easy to use and configure, so it will not be necessary to use the SD card.

Share:

Facebook
Twitter
Pinterest
LinkedIn

Leave a Reply

Your email address will not be published. Required fields are marked *

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