Nov 242011
 

How to copy a file or entire directory over ssh, archived or not. Using ssh only, in case scp or sftp aren’t available.

Directory, Local -> Remote

The “-” after the “f” in tar redirects, so first tar archives the directory to stdout which gets piped to the other side and becomes input for the second tar. “z” can be replaced with “j” for better compression if both tar know about it.

Directory, Remote -> Local

File, Local -> Remote

File Remote -> Local

Directory/File Remote1 -> Remote2

 

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)