Specifying a port for scp to use


This is a trick that gets me every time. To specify a port for ssh you need the argument -p but for scp it is -P. scp -p preserves the modification times of the files you are transferring. I’d love to know why they are different. I can only assume it’s because the need to preserve modification times came before the need to specify a port and they wouldn’t change backward compatibility.

Summary;

ssh -p
scp -P
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s