HOWTO use scp
Posted by notKlaatu , 29 March 2008 · 75 views
WHATIS:scp is a Secure CoPy, akin to ssh. A convenient but encrypted way to move files from machine to machine on your network.A REALLY GOOD HOWTO:Linux Tutorials Blog...or you can read my very brief but-it-does-the-trick HOWTO:(I do recommend you check out the HOWTO on Linux Tutorial Blog at some point for all the cool tricks you can do with scp)The syntax for the scp command is as follows: scp [options] [[user@]host1:]filename1 ... [[user@]host2:]filename2 For example, if user klaatu is on a computer called fedora.laptop, and wants to copy a file called file.txt to slackware.com, he would enter the following: scp file.txt firstname.lastname@example.org he wanted to place file.txt specifically into a directory called destination/ then he would do this:scp file.txt email@example.com:destinationor to be extra safe, you could give the complete path, like so:scp file.txt firstname.lastname@example.org:/home/klaatu/DocumentsLikewise, if he wanted to copy the entire contents of the destination/ directory on slackware.com back to his fedora.laptop (so that's FROM a remote machine TO the machine you're sitting in front of), he would enter:scp -r email@example.com:/home/klaatu/directory destinationSimilarly, if he is working on an entirely different computer, but wanted to copy a file called file.txt from his home directory on fedora.laptop to a directory called desitination in his account on slackware.com, he would enter: scp firstname.lastname@example.org:file.txt email@example.com:destinationWhen using wildcards (e.g., * and ? ) to copy multiple files from a remote system, be sure to enclose the filenames in quotes...because the shell expands unquoted wildcards.