scp -P 2222 file.txt user@host:/path/

Category: SSH & Remote

scp -P 2222 file.txt user@host:/path/

Copy to remote host on a non-default port

Copies to a remote server on a non-default port. Note: SCP uses -P (capital) unlike SSH which uses -p.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.