DEV Community

Discussion on: Command Line Snippets do you keep handy?

Collapse
 
brandinchiu profile image
Brandin Chiu

When I want to transfer a file to a remote server without going through the security headaches of installing ftp servers:

cat file.txt | ssh me@ip_address "cat > newfile.txt"

Collapse
 
fboaventura profile image
Frederico Freire Boaventura

Hi Brandin!

You may also use:

scp file.txt me@ip_address:newfile.txt

scp file.txt me@ip_address:/var/www/newfile.txt

scp -r folder me@ip_address:

if you don't add anything after the : the file/folder being transfered will be stored on the user's home folder.