Best 3 Ways to Transfer Files from Linux Server to Local Machine

Here we want to discuss 3 Free ways to Transfer Files from Linux Server to Local Machine which include using the SCP, Rsync, and SFTP Tools. There are many ways that you can transfer your files from a Linux server to a local machine. You can follow the steps below provided by the Orcacore team to see how you can Transfer Files from Linux Server to Local Machine.

3 Free Ways to Transfer Files from Linux Server to Local Machine

To complete this guide, you must have access to your Linux server as a root or non-root user with sudo privileges. Also, you must have SSH installed on both servers. For this purpose, you can visit the Orcacore website and search for the SSH installation guides on Linux.

Then, follow the steps below to see how you can Transfer Files from Linux Server to Local Machine.

Transfer Linux files with 3 methods
Transfer Files from Linux Server to Local Machine

Method 1 – Use SCP in Linux for Transfering Files

The SCP must be installed by default on Linux servers. The syntax to transfer files with SCP to a local machine is as follows:

scp <option> <remote username>@<IP address or local hostname>:<file path to transfer> <local file location>

For example:

scp remoteuser@10.0.0.8:/remote/source_file.txt /path/to/local/directory

This will transfer the source_file.txt to the defined local directory.

Also, you can transfer files recursively by using the -r option. This will transfer the entire directory. For example:

scp -r remoteuser@10.0.0.8:remote/ /path/to/local/directory

Note: To get more information about SCP, you can visit this guide on Using SCP to Transfer Files with SSH keys.

Method 2 – Use Rsync in Linux to Transfer Files to Local Machine

The Rsync command must be installed by default on Linux distros. The syntax of this command to transfer files to a local machine is like the following:

rsync <option> <remote user]@[remote IP address or remote hostname>:<source directory> <destination directory>

You can transfer only files with Rsync. For example:

rsync remoteuser@10.0.0.8:remote/* /path/to/local/directory/

The option slash / after the remote directory means to transfer only its contents. The * option means sending every file.

Also, you can recursively transfer files with rsync. For example:

rsync -r remoteuser@10.0.0.8:remote/ /path/to/local/directory

This will transfer the entire remote directory.

Method 3 – Use SFTP For Transfering Files

Also, the SFTP tool is installed default on Linux distros. The syntax is like:

sftp> get <option> <remote file> <local destination>

To transfer files, log in to your Remote server and use Sftp to download the files.

For example:

sftp remoteuser@10.0.0.8
sftp> get remote/source_file.txt /path/to/local/directory

Also, you can recursively transfer files by using the -r option, and -P maintains the file permissions and access times.

sftp remoteuser@10.0.0.8
sftp> get -Pr remote/ /path/to/local/directory

Conclusion

At this point, you have learned 3 Ways to Transfer Files from Linux Server to Local Machine which include using the SCP, Rsync, and SFTP Tools. These are the most useful tools that you can use to transfer your files in your Linux distributions. You can easily choose your desired method and start transferring files from the server to a local machine on Linux.

Hope you enjoy it. Also, you may like to read the following guides and articles below:

Pass password to scp command in Linux using sshpass example

ProFTPD Setup Guide on Debian 12 Bookworm

Create a Bootable USB Without Rufus

Secure Alpine Linux Using CSF Firewall

Modify Alpine Linux Hostname

Share your love

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!