SCP Command Examples
SCP stands for 'secure copy' its a good way of sending files over a network securely. to use this command you need to have SSH installed.
(for those of you who don't know SSH (secure shell) is a protocol for securely connecting to a remote machine)
a good example of SCP is shown below:
scp somefile someUser@ipaddress
Its quite simple to use really, you'll find it useful if you use SSH a lot as I do.
Below I have listed a few fun/interesting scp commands. Enjoy :D
Edit a file on a remote host using VIM
I find this useful when you don't want to take the file, only edit it.
Compare a remote file with a local file
vimdiff afile.txt scp://[user@]host/<anotherfile.txt>
Again this is just as useful as the one above. you can also use this for coloured difference between to remote hosts.
vimdiff scp://user@server//path/to/file scp://user@server//path/to/file
SCP with Compression
scp -C 10.0.0.4:/tmp/backup.sql /path/to/backup.sql
-C - Compression
useful for all the DB heads out there.
SCP from one machine to another while logged into a third
scp user@hostb:file user@hostc:
scp a file from host b to host c while logged into host a. kinda fun I think
SCP a file to the same location on the remote machine
scp filename root@remote:`pwd`
this is very useful, I mean you could just write the path...but the pwd is there for a reason!