an alias to copy directories and folders to a remote server

create a shortcut to quickly send data to a specific location on a remote server

Using the following syntax you can create easy-to-remember, snappy terminal aliases to copy files and directories to a specific location on a remote servers:

alias cpserver 'scp -r "\!*" myUserName@some.remote.server:/home/myUserName/from_mac/'

Adding this to my .bashrc file allows me to copy data to my remote server with the command:

cpserver <filename.ext>

and even recursively copy a folder:

cpserver <directoryName>