9951 explained code solutions for 126 technologies


sshQuickly copy large number of files using scp.


tar czf - file1 dir2 | ssh [email protected] "cd /path && tar xvzf -"ctrl + c
tar czf
  • create gzipped tar and send result to output
file1 dir2

list of files or directories to gzip (file1 and dir2 in our case)

|

send output from the left command to the right

ssh [email protected]

remote user and server address

cd /path

go to the directory we want to copy file to

tar xvzf
  • ungzip and untar files from input (sent by local tar command)