Thanks to I can avoid creating files which need to be scp’d: I can pipe the content directly:

local$ cat localfile.txt | ssh remote "cat - >> remotefile.txt"

For this to work, I have already got “remote” set up in my ~/.ssh/config. You can get much more involved in this: see

My favourite example from the last site (execute commands on remote server but save the output to local) is:

ssh "mysqldump -u DB_username -pDB_password DB_name | gzip -c" > /local/dir/DB_backup.gz

Thu 2011-12-08

unix utilities proxy ssh