Gotta love the one line remote transfer command

While browsing the web today, the following line caught my attention:

tar czf - ~/myproject | ssh www.example.com tar xvzf - 

This line came from this article. This type of one-liner commands reminded me of an engineer that I admire and he loves this type of usage. Personally, I love to use ssh, it is equivalent to secure telnet, secure copy secure VNC, secure port-forwarding/tunneling. Very handy. I would probably just use scp to transfer files most of the time. However, the above command will preserve ownership and permission on files and directories. So, use it if that is important to you.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s