Anjan Nair
Anjan's Blog

Anjan's Blog

Secure Copy over SSH

Secure Copy over SSH

Send files over SSH using SCP by using basic bash commands.

Anjan Nair's photo
Anjan Nair
·Aug 10, 2022·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

Table of contents

  • What is SCP?
  • Syntax

To transfer files between the Raspberry Pi and the host device or vice versa we use a simple command called scp. Now I like to use a headless Raspbian OS without a GUI on the Raspberry Pi as it saves resources which would be otherwise spent unnecessarily.

What is SCP?

SCP short for Secure Copy uses SSH (secure shell) to transfer files between 2 devices. In my experience I hae tested this out with movies as big as 3GB. Although yes it does take some time it has been one of the easiest and convenient method for me!

Syntax

scp example.mp4 pi@192.168.1.1:/home/pi/Movies

For downloading files from the other computer/server to the local machine

scp username@192.168.1.1:path_to_file path_in_the_local_machine

You have to replace example.mp4 with the file you intend to copy over, replace the pi@192.168.1.1 with your SSH address and /home/pi/Movies with the path you want your movie to be in.

Additional Points

1) If you are sending a folder don't forget to add a -r (recursive tag) 2) You can send multiple files/folders just by adding them one after another (with space) after example.mp4

 
Share this