LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-13-2012, 07:12 AM   #1
kiranonlinuxque
LQ Newbie
 
Registered: Feb 2011
Posts: 11

Rep: Reputation: 11
[SOLVED] how to untar a tar.gz file on another machine


Hi,
I have a 50gb of file.tar.gz. I cannot untar it on the same machine as the space is very low.
How can I untar the file on some other machine in the same network, without moving the original file to that machine.

Thanks
Kiran

Last edited by kiranonlinuxque; 09-13-2012 at 08:08 AM.
 
Old 09-13-2012, 07:29 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,058

Rep: Reputation: Disabled
Hi,

AFAIK, you can't.

You could launch the command from the other machine with some directory on that other machine as a target but then you will have to transfer a much heavier load than that of the original file.

So either move the original file on a physical support or through the network, with wget or rsync.

Maybe I am lacking of imagination, so I'd be glad to recognize I was wrong if that's the prize I have to pay to learn something
 
Old 09-13-2012, 07:43 AM   #3
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
If you have a sshd running on the machine with the big tar archive and an ssh client on the one you are copying to, then you could do this:

Code:
ssh machinewitharchive "cat /path/to/file.tar.gz" | tar xz
EDIT: Actually it would work the other way as well (ssh client on the machine with the big file and ssh server on the receiving machine):

Code:
cat /path/to/file.tar.gz | ssh machinereceivingarchive "tar xz"
Don't you just love tar pipes?

EDIT 2: Another option would be to use network shares. Then you could mount the directory containing the big archive on the receiving machine and just do a regular "tar xf file.tar.gz". NFS or SMB/CIFS would be obvious options for this. Alternatively could still use ssh via SshFS/Fuse or perhaps fish:// in a file manager like Dolphin and then use Ark to unpack.

Last edited by ruario; 09-13-2012 at 07:59 AM.
 
Old 09-13-2012, 08:07 AM   #4
kiranonlinuxque
LQ Newbie
 
Registered: Feb 2011
Posts: 11

Original Poster
Rep: Reputation: 11
That's a lot of info ruario. Thank you so much. It worked.
[SOLVED]
 
Old 09-13-2012, 08:09 AM   #5
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Quote:
Originally Posted by kiranonlinuxque View Post
It worked.
Cool, thanks for letting me know!

EDIT: Out of interest, tar pipe or remote mount? I'm hoping you used a tar pipe, just because it is more fun and geeky!

Last edited by ruario; 09-13-2012 at 08:10 AM.
 
Old 09-13-2012, 08:35 AM   #6
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Just as an F.Y.I. tar pipes involving BSD tar would let you do really funky stuff like copy the contents of a gzip compressed tar on one machine and convert on the fly to another format, say a xz compressed cpio file.

Code:
cat /path/to/file.tar.gz | ssh machinereceivingarchive "bsdtar -cf- --format cpio @- | xz > file.cpio.xz"
Why would you ever do this? I don't know, other than because it is awesome that it is even possible.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
massive tar file, can't untar dtra Linux - Software 3 09-08-2011 04:32 AM
error when attemting to untar a .tar.bz2 file stephenthemartyr Linux - Newbie 28 07-27-2011 08:40 AM
'Read-only file system' when untar a tar.bz2 file yinglcs Linux - General 1 02-18-2006 09:12 PM
Getting problem when untar the .tar.gz file? ramakumard77 Linux - General 2 11-29-2004 11:15 AM
How to untar and unzip .tar.gzip.part file? linuxharsha Linux - Software 2 02-14-2004 10:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration