ssh and scp
Sending a single or a few files
scp /path/to/src/file user@server:/path/to/destination
Sending lots of files at once[1]
tar -C /path/to/src/dir -jcf - ./ | ssh user@server 'tar -C /path/to/dest/dir -jxf -'
- For
tar
, the flags are:j
for filtering/compressing using thebzip2
algorithm,c
for creating a new archive, andf
is for where it should send the new contents of the tar file; the hyphen signifies the contents of the new tar file should be piped. - For the
ssh
section, the othertar
flag isx
for extract the archive.
References
Last modified: 202401040446