Manfredo
Manfredo

Reputation: 1740

Flexible scp alias

Suppose I have three files named myfile1.dat myfile2.dat myfile3.dat

scp myfile*.dat [email protected]:./

would copy them in my remote directory.

Is there an alias to shorten this, possibly one that would also consider different input like folders, that is something like

myscp [scp options (like -r) only if given] [file name] [path in remote directory] 

Using OS X

Upvotes: 1

Views: 640

Answers (1)

Jakuje
Jakuje

Reputation: 25956

You can use ssh config to store login information like this in file ~/.ssh/config:

Host r
  HostName remote.com
  User login

And then copy files:

scp myfile*.dat r:

I don't think there is a way to shorthen this command more.

Upvotes: 3

Related Questions