extract from TAR


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users extract from TAR
# 1  
Old 07-27-2005
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  
Old 07-27-2005
After the tar extraction, cant you delete the tar file ? Smilie

Vino
# 3  
Old 07-27-2005
Quote:
Originally Posted by vino
After the tar extraction, cant you delete the tar file ? Smilie

Vino
Sounds like maybe he doesn't have enough disk space for both at once? Not sure.
# 4  
Old 07-27-2005
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  
Old 07-27-2005
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  
Old 07-27-2005
Tools

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

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 Smilie
# 7  
Old 07-27-2005
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 ...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Tar extract Z file

I was looking at this tutorial for tar extract Z file. Is there a reason why this did not work? I checked my man pages and it had a -Z option. tar -xZvf /opt/Nimsoft/nimldr.tar.Z tar (child): compress: Cannot exec: No such file or directory tar (child): Error is not recoverable: exiting now... (2 Replies)
Discussion started by: cokedude
2 Replies

2. UNIX for Dummies Questions & Answers

Do I need to extract the entire tar file to confirm the tar folder is fine?

I would like to confirm my file.tar is been tar-ed correctly before I remove them. But I have very limited disc space to untar it. Can I just do the listing instead of actual extract it? Can I say confirm folder integrity if the listing is sucessful without problem? tar tvf file1.tar ... (1 Reply)
Discussion started by: vivien_chu
1 Replies

3. Linux

extract glibc-2.3.2.tar.tar

Hi, how can I extract glibc-2.3.2.tar.tar file ? I used tar -xf but does not work. Thank you. (4 Replies)
Discussion started by: big123456
4 Replies

4. UNIX for Dummies Questions & Answers

tar extract to new path

I need to extract a file,which contains the path to a new path. sample tar file tar -tfv class.tar | grep client -rw------- 0/1 99 Jan 22 12:46 2004 /usr/openv/netbackup/db/class/mariner/clients -rw------- 0/1 102 Sep 25 11:33 2007... (1 Reply)
Discussion started by: jouuu
1 Replies

5. UNIX for Dummies Questions & Answers

Error when tar extract

I've got this Files.tgz containing Fruits/Apple.txt Drinks/Soda.txt Drinks/Pepsi.txt I would like to extract all files/directories with pattern "Fruits". So, what I did was tar -xvf File.tgz `tar -tf Files.tgz | grep 'Fruits'` However, output is:- Files/Fruits... (8 Replies)
Discussion started by: percivalwcy
8 Replies

6. UNIX for Advanced & Expert Users

tar extract to different directory

Hi, I created a tar file of a directory dir1 from /tmp in the following way $pwd /tmp $tar -cvf dir1.tar dir1 (dir1 will have say file1) Now i want to extract it in the directory /tmp/dir2 so that the directory dir1 is also created and extracted... (1 Reply)
Discussion started by: ammu
1 Replies

7. Shell Programming and Scripting

extract one file form .tar.gz without uncompressing .tar.gz file

hi all, kindly help me how to extract one file form .tar.gz without uncompressing .tar.gz file. thanks in advance bali (2 Replies)
Discussion started by: balireddy_77
2 Replies

8. UNIX for Dummies Questions & Answers

tar. I can't extract

Hi, I am Nico. I have a tarball that i can't extract. I have this file: FlussiIbox.20060215.tar when i write "tar tf FlussiIbox.20060215.tar" the output is: /u01/USCITA/jobs/SUNRISE/output/IBOX.counter.20060212.dat.gz /u01/USCITA/jobs/SUNRISE/output/IBOX.counter.20060213.dat.gz... (1 Reply)
Discussion started by: volleyboy
1 Replies

9. UNIX for Dummies Questions & Answers

TAR (Extract with subfolders)

Hi! I've uploaded a .tar file (created with Windows) containing my homepage to my webserver. Now I'd like to extract the file on the server. I can do that with SSH. BUT:: If i enter this command: tar -xf homepage.tar only the files in the root directory of the file get extracted.... (2 Replies)
Discussion started by: roberthawke
2 Replies

10. UNIX for Advanced & Expert Users

extract from tar backup

Hi All, I have created a tar file by giving the below command : all files of directory : /Accounts/2001/10/26 $tar -cvf Act26.tar /Accounts/2001/10/26 I copied into another server and given the following command: $tar -xvf Act26.tar then permision denied message came due to the... (3 Replies)
Discussion started by: krishna
3 Replies
Login or Register to Ask a Question