SCP is similar to the CP or copy command, but it’s done via a secure network.

Here’s a CP command.

<pre lang="bash">
cp /dir1/filename /dir2

You can use SCP to copy file to another system. It requires login.

<pre lang="bash">
scp /dir1/filename user@server:/home/user

This is using SCP to copy a file from 2 remote systems.

<pre lang="bash">
scp user@host1:/home/user/dir1/file.txt user@host2:/home/user/dir2