Skip to main content

How to copy file between linux machines

Need to copy file between linux machines? There are several ways to achieve this. One of the most common methods is to use the "scp" command in a terminal window. This command stands for "secure copy" and is used to transfer files securely over a network. If you are working with cloud servers, see our guide on setting up a secure EC2 instance.

How to copy file from local to server

Using the scp Command

bash
scp /path/to/local/file remote_user@remote_host:/path/to/remote/file

How to copy file from server to local

bash
scp remote_user@remote_host:/path/to/remote/file /path/to/local/file

How to copy file from server to server

bash
scp [OPTION] [user@]src:]file1 [user@]dest:]file2

Related Articles