The command scp copies files to a remote machine. The following examples shows the most common used options and arguments. The examples pretent you are on host jupiter:
MyLetter.tex sun:
copies the file MyLetter.tex
from the host jupiter
to the host sun. The file appears inside the home
directory of the current user on sun.
MyLetter.tex tux@sun:
copies the file MyLetter.tex
from the host jupiter
to the host sun, but uses a the user
tux
on the host
sun.The file appears inside the home directory of user
tux.
-l
tux
MyLetter.tex sun:
the same than the last command, but with a slightly different syntax.
-r
src/ sun:backup/
recursive copying of the entire src
directory
from the host jupiter to the host sun. The source directory
appears inside the directory backup
.
After the correct password is entered, scp starts the data transfer and
shows a growing row of asterisks, simulating a progress bar. In addition,
the program displays the estimated time of arrival to the right of the
progress bar. Suppress all output with the option -q
.
The option -p
tells scp to leave the time stamp of files
unchanged. -C
compresses the data transfer. This
minimizes the data volume to transfer, but creates a heavier burden on
the processor.