/kb

personal knowledgebase

Simple scp script for copying to SSH enabled accounts

without comments

I frequently use scp to copy files to shell accounts. It’s quite annoying to type the full account info each time, so by writing a very small and very simple shell script some typing can be saved:

#!/bin/bash
scp -r "$1" login@server.domain.com:$2

The script copies file $1 to the destination $2 on the server. With -r option directories are copied as well. The “” are for taking care of file/directory names with spaces in.

Theoretically related posts

Written by hgrimelid

April 10th, 2008 at 9:37 am

Posted in Scripts

Tagged with , , , ,

Leave a Reply