SCP-How-To

SCP-How-To

2017-01-22. Category & Tags: SSH, SCP, Sync

Local flder t1/, file tt1.

example:
scp -r -P 22 t1/ [email protected]:/mnt/share/t2/
-r: recursively.
-P: Port nr. Note: captical char.
Result:

  • if /mnt/share/ has folder t2/, t1/ will be in t2/.
  • if no such a dir, t1/ will be renamed as t2/ inside share/.
  • if there is file t2: mnt/share/t2, will get error “scp: /mnt/share/t2: Not a directory”.
  • scp will NOT create new folder on server.