- Last edited 11 months ago ago
How to transfer a file over network
1 Article purpose
The article aims to give some information useful to start with the scp Linux command.
This article focuses on the file transfer between a host PC and a STMicroelectronics board over a network connection.
3 Installation on your target
The scp is installed on the STMicroelectronics images via the package openssh.
4 Installation on your PC
The package openssh-client must be installed on your host PC to perform a file transfer over network with the scp.
PC $> sudo apt-get install openssh-client
5 Getting started
- Your host PC and your board are connected to your local network through
- The board IP address (<board ip address>) has been retrieved thanks to the ip Linux command line
- Upload a file (<host file path>/<example.txt>) from your host PC to your board:
PC $> scp <host file path>/<example.txt> root@<board ip address>:/<board file path>/
Example (assuming that <board ip address> is a.b.c.d): Copy the example.txt host PC file in the /home/root/ board directory PC $> echo "scp example: from host PC to board" > ./example.txt PC $> scp ./example.txt firstname.lastname@example.org:/home/root Check the result on the board Board $> cat /home/root/example.txt scp example
- Download a file (/<board file path>/<example.txt>) from your board to your host PC:
PC $> scp root@<board ip address>:/<board file path>/<example.txt> <host file path>/
Example (assuming that <board ip address> is a.b.c.d): Copy the example.txt board file in the current directory of the host PC Board $> echo "scp example: from board to host PC" > /home/root/example.txt PC $> scp email@example.com:/home/root/example.txt ./ Check the result on the host PC Board $> cat ./example.txt scp example: from board to host PC