The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
column extract help cvm Shell Programming and Scripting 1 04-24-2008 04:19 PM
extract using sed/awk - need help? Please!! gzs553 Shell Programming and Scripting 5 10-08-2007 04:54 PM
How to extract the PID from 'ps -ef' nsinha Shell Programming and Scripting 7 11-20-2006 07:47 AM
Please help! Sed extract a pattern zhen Shell Programming and Scripting 11 09-18-2006 12:36 PM
tar. I can't extract volleyboy UNIX for Dummies Questions & Answers 1 02-17-2006 11:54 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-27-2005
big123456 big123456 is offline
Registered User
  
 

Join Date: May 2005
Posts: 200
extract from TAR

Hi,
when I extract a TAR archive by tar -xf file.tar
the file.tar file stays on disk. Then I need two time the disk space.
How can I avoid that ? How to ask not to keep file.tar ?
Many thanks.
  #2 (permalink)  
Old 07-27-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
After the tar extraction, cant you delete the tar file ?

Vino
  #3 (permalink)  
Old 07-27-2005
sysera sysera is offline
Registered User
  
 

Join Date: Feb 2004
Posts: 92
Quote:
Originally Posted by vino
After the tar extraction, cant you delete the tar file ?

Vino
Sounds like maybe he doesn't have enough disk space for both at once? Not sure.
  #4 (permalink)  
Old 07-27-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Quote:
Originally Posted by big123456
Hi,
when I extract a TAR archive by tar -xf file.tar
the file.tar file stays on disk. Then I need two time the disk space.
I assume the o/p had a successful tar extraction and then realized the space consumed was twice the size of the tar file.

If the o/p ran out of space, I dont think tar extraction would have completed. I havnt encountered such a situation tho'.


Cheers'
Vino
  #5 (permalink)  
Old 07-27-2005
big123456 big123456 is offline
Registered User
  
 

Join Date: May 2005
Posts: 200
Hi,
effectively I have a disk space problem. If I have a 50Gb tar file, I should have a 100 Gb disk although at the end I delete my file.tar and again I have 50Gb which is not used. Then is there any option permiting to use a disk of 50Gb?
many thanks.
  #6 (permalink)  
Old 07-27-2005
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,796
Cool

So, you want to do the untaring with just 50Gb of space.

This is what I have in mind. And I shall try to attempt it here.

Get the tar listing onto a list.txt
For each file-name from list.txt
Extract file-name from file.tar
Delete file-name from file.tar

Code:
#! /bin/sh

tar tf big.tar > big.txt

while read file
do
(tar xf big.tar $file) && (tar --delete --file=big.tar $file)
done < big.txt
This should do it.

Check it out.

Vino
  #7 (permalink)  
Old 07-27-2005
big123456 big123456 is offline
Registered User
  
 

Join Date: May 2005
Posts: 200
thank you. I'm runing Solaris.
I made a script from your code. this is the output :
$myscript
tar: d: unknown option
Usage: tar {txruc}[vfbFXhiBDEelmopwnq[0-7]] [-k size] [tapefile] [blocksize] [exclude-file] [-I include-file] files ...
tar: d: unknown option
Usage: tar {txruc}[vfbFXhiBDEelmopwnq[0-7]] [-k size] [tapefile] [blocksize] [exclude-file] [-I include-file] files ...
tar: d: unknown option
Usage: tar {txruc}[vfbFXhiBDEelmopwnq[0-7]] [-k size] [tapefile] [blocksize] [exclude-file] [-I include-file] files ...
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:39 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0