scp file code example
Example 1: scp send file
scp ./file.txt remote_username@remote_ip:/remote/directory
Example 2: scp folder from server to local
scp -r [email protected]:/path/to/foo /home/user/Desktop/
Example 3: scp file download
scp [email protected]:filename.zip ~/Desktop/
Example 4: scp file
scp [source file] [destination]
scp file.txt user@ip:/Desktop/
For directories, add the -r tag
scp -r [source dir] [destination]
scp -r dir/ user@ip:/Desktop/
Example 5: using scp
scp [email protected]:/remote/file.txt /local/directory