scping files with streamlines compression (tar gzip)

tar czv file1 file2 folder1 | ssh user@server tar zxv -C /destination
it compresses the files and folders to stdout, secure copies it to the server's stdin and runs tar there to extract the input and output to whatever destination using -C. if you emit "-C /destination", it will extract it to the home folder of the user, much like `scp file user@server:`. the "v" in the tar command can be removed for no verbosity.

By: xsawyerx
2009-01-29 10:38:26

What Others Think

This can be more succinct if you have rsync. Secure remote copy with default compression: rsync -rptlvz -e ssh path1 path2 user@host:path Secure remote copy with configurable compression FTW: rsync -rptlv --compress-level 9 -e ssh path1 path2 user@host:path
laburu · 693 weeks and 1 day ago
@laburu I don't understand your example.. Could you break it down further? I was needing to copy over a large data file from a remote machine to my local one and I wanted to compress it, so I just used the command: rsync -Pz user@host:/path/ .
DEinspanjer · 690 weeks and 6 days ago
And in case you don't need to untar the file at the other end: tar zcvf - folder | ssh user@server "cat > /backup/folder.tar.gz"
rugina · 570 weeks and 3 days ago
doula las vegas Whoa! I just can't believe I found this site
yeoyeo · 79 weeks ago
awesome. learned alot. keep posting more hair extensions salon near me
looneyhans · 65 weeks and 2 days ago
Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. ????
KayGasaway · 62 weeks and 5 days ago
Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. ??
KayGasaway · 62 weeks and 2 days ago
I am incapable of reading articles online very often, but I’m happy I did today. It is very well written, and your points are well-expressed. I request you warmly, please, don’t ever stop writing. ????
KayGasaway · 61 weeks and 3 days ago
This is my first time i visit here. I found such a substantial number of interesting stuff in your blog especially its examination. Really its inconceivable article. Keep it up. safestore auto
KayGasaway · 61 weeks and 2 days ago
Love to read it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. ??? 1?
KayGasaway · 60 weeks and 6 days ago
Great article with excellent idea!Thank you for such a valuable article. I really appreciate for this great information.. Onewheel XR Accessories
KayGasaway · 59 weeks and 2 days ago
Extraordinary things you've generally imparted to us. Simply continue written work this sort of posts.The time which was squandered in going for educational cost now it can be utilized for studies.Thanks Onewheel Accessory
KayGasaway · 58 weeks and 5 days ago
When a blind man bears the standard pity those who follow…. Where ignorance is bliss ‘tis folly to be wise…. IT Support companies Beverlywoods Los Angeles, California
KayGasaway · 58 weeks and 2 days ago
Our website is a place where every man will gain self-confidence, a guarantee of proven products and 100% understanding. We created the website because we want to help in the fight against what is not talked about loudly. Kamagra
KayGasaway · 56 weeks and 5 days ago
If you’re looking for where to get top-notch samples for music, then you’ve come to the right place. Producers Wave has you covered for any music genre, format, DAW, or style. All our sounds are created by professional producers and sound designers for your inspiration. They are all royalty-free for both personal and commercial use. No attribution is needed. We believe there’s bound to be something here that matches your production. hip hop sounds
KayGasaway · 56 weeks and 1 day ago
Buy high quality cannabis and vape proudcts from us at great prices. Weed, flowers, cbd oil, vapes, pre-rolls, extracts and have them delivered to you. small cannabis seeds
KayGasaway · 55 weeks and 6 days ago
Qikink is Indias largest Print On Demand Dropshipping company. Sell Custom branded T-Shirts, Hoodies, Phone Cases, Coffee Mugs & More. Signup Today Custom T-Shirt Printing
KayGasaway · 55 weeks and 6 days ago
Due to the current situation, we’re taking extra precautions to ensure the safety and well-being of our customers and employees. We are closely following Government guidelines. With this in mind, our services will continue to be fully operational.">hot tub maintenance
KayGasaway · 55 weeks ago
As a Family Owned & Operated Fence Installations business quality control, great results and value are always our goal.">vinyl fence cape coral
KayGasaway · 54 weeks and 5 days ago
Daryl is an energetic professional CFO with a background in politics. Daryl has done fundraising, been a candidate, and worked in politically appointed positions in Pennsylvania and Philadelphia. Daryl has worked for Democratic candidates and nominees in 18 additional states.">Daryl Lafountain
KayGasaway · 54 weeks and 3 days ago
Upgrade your classroom performance and attendance with Class Companion. CritiColl provides the fast and secure online class attendance and management app.">Class Attendance App
KayGasaway · 54 weeks and 2 days ago
For a long time me & my friend were searching for informative blogs, but now I am on the right place guys, you have made a room in my heart! eye doctor broken arrow
KayGasaway · 52 weeks and 5 days ago
Most complete guide on angelite meaning, benefits, spiritual connection to the Zodiac, birthstone, numerology, and feng shui Shop Angelite for sale.
ayesha · 52 weeks ago
We have been operating out of our scrap yard located right here in the city of Mississauga and we buy and process cars locally this gives our customers the best & instant price possible for their old Vehicles scrap car removal mississauga
KayGasaway · 48 weeks and 6 days ago
Best New Bingo Sites 2021 A2Z Sister Site | The Best Place To Find Casinos & their Sister Sites, UK Largest Casino SisterSites ListChoose from A-Z catalogue with best offers. Please visit our website for more information and limited offers. Thank You.
KayGasaway · 43 weeks and 1 day ago
seofox · 26 weeks ago
It is the kind of information I have been trying to find. Thank you for writing this information. It has proved utmost beneficial for me. ?????
JosephWhitaker · 13 weeks and 6 days ago
Wonderful blog! Do you have any tips and hints for aspiring writers? Because I’m going to start my website soon, but I’m a little lost on everything. Many thanks!
JosephWhitaker · 13 weeks and 6 days ago
I think this is an informative post and it is very beneficial and knowledgeable. Therefore, I would like to thank you for the endeavors that you have made in writing this article. All the content is absolutely well-researched. Thanks...
JosephWhitaker · 11 weeks and 1 day ago
All your hard work is much appreciated. Nobody can stop to admire you. Lots of appreciation. 5F-SGT-151 kaufen
JosephWhitaker · 11 weeks ago
Excellent blog! I found it while surfing around on Google. Content of this page is unique as well as well researched. Appreciate it.
JosephWhitaker · 9 weeks and 5 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: