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.

13
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 · 662 weeks and 6 days 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/file.name .
DEinspanjer · 660 weeks and 5 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 · 540 weeks and 1 day ago
doula las vegas Whoa! I just can't believe I found this site
yeoyeo · 48 weeks and 5 days ago
awesome. learned alot. keep posting more hair extensions salon near me
looneyhans · 35 weeks ago
Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. ????
KayGasaway · 32 weeks and 3 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 · 32 weeks 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 · 31 weeks and 1 day 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 · 31 weeks ago
Love to read it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks. ??? 1?
KayGasaway · 30 weeks and 4 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 · 29 weeks 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 · 28 weeks and 3 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 · 28 weeks 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 · 26 weeks and 4 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 · 25 weeks and 6 days 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 · 25 weeks and 4 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 · 25 weeks and 4 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. http://network-marketing.ning.com/profiles/blogs/very-important-components-to-a-whole-pool-service-provider">hot tub maintenance
KayGasaway · 24 weeks and 5 days ago
As a Family Owned & Operated Fence Installations business quality control, great results and value are always our goal. http://network-marketing.ning.com/profiles/blogs/qualities-to-measure-if-selecting-the-best-fence-company">vinyl fence cape coral
KayGasaway · 24 weeks and 4 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. http://network-marketing.ning.com/profiles/blogs/thinking-about-go-with-an-important-human-information-consultant">Daryl Lafountain
KayGasaway · 24 weeks and 2 days ago
Upgrade your classroom performance and attendance with Class Companion. CritiColl provides the fast and secure online class attendance and management app. http://network-marketing.ning.com/profiles/blogs/for-what-reason-decide-upon-cloud-based-over-the-internet-class">Class Attendance App
KayGasaway · 24 weeks and 1 day 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 · 22 weeks and 3 days ago
Most complete guide on angelite meaning, benefits, spiritual connection to the Zodiac, birthstone, numerology, and feng shui Shop Angelite for sale.
ayesha · 21 weeks and 6 days 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 · 18 weeks and 5 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 · 12 weeks and 6 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?

commandlinefu.com 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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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: