This article is composed of the following sections:
The general form of the command is:
% scp source-specification destination-specification
where source-specification indicates which file or directory is to be copied, and destination-specification indicates where the copied material is to be placed.
Either the source or the destination may be on the remote machine; i.e., you may copy files or directories into the account on the remote system OR copy them from the account on the remote system into the account you are logged into.
Example:
% scp myfile xyz@sdcc7:myfile
To copy a directory, use the -r (recursive) option. Example:
% scp -r mydir xyz@sdcc7:mydir
The format for the remote specification (source or destination) is:
user@machine:filename
where filename is the name (path) of the file or directory relative to the home (login) directory on the remote system.
The format for file specification on the local system is just:
filename
where fname is the name (path) relative to the current working directory on that system.
% scp letter abc@sdcc3:application
% scp xyz@sdcc7:foo bar
% scp comix/garfield abc@sdcc3:stuff/fatcat
% scp xyz@sdcc7:comix/garfield stuff
% scp -r Section xyz@sdcc7:Chapter
% cd
% cd ..
% scp -r abc ir123@iacs5:abc
For more information about the scp (secure copy) command, check the on-line manual page for scp:
% man scp