unzip .tgz files

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers unzip .tgz files
# 1  
Old 02-09-2002
unzip .tgz files

hi all

How to unzip .tgz files

waiting for suggestions
# 2  
Old 02-09-2002
tgz files are gzip compressed tar archives. You can extract them like this : tar xzf filename
# 3  
Old 02-09-2002
I think the previous reply may have left off something. The full command is like this:

gzip -cd <filename.tgz> | tar xvf -

You could do each commmand separately, but if your resulting tar file is too large, tar xvf will not work.
# 4  
Old 02-09-2002
A user may untar a compressed (gzipped) tar file with:

tar -zxvf <filename>

The z flag instructs tar to use gzip. A seperate gzip pipe is not required.

Of course, the v flag is not necessary, just makes gzip quite talkative Smilie

DanielB is quite correct when he suggests that a .tgz file may be untarred with -zxf switches (only).
# 5  
Old 02-09-2002
My mistake, I was reading fast and read "xvf" instead of "xzf".
# 6  
Old 02-09-2002
Well, you may still need to gunzip it first. Some tars' (non-GNU) do not understand the z option.

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unzip all the files with subdirectories present and append a part of string from the main .zip files

Hi frnds, My requirement is I have a zip file with name say eg: test_ABC_UH_ccde2a_awdeaea_20150422.zip within that there are subdirectories on each directory we again have .zip files and in that we have files like mama20150422.gz and so on. Iam in need of a bash script so that it unzips... (0 Replies)
Discussion started by: Ravi Kishore
0 Replies

2. Shell Programming and Scripting

Extracting specific files from multiple .tgz files

Hey, I have number of .tgz files and want to extract the file with the ending *results.txt from each one. I have tried for file in *.tgz; do tar --wildcards -zxf $file *results.txt; doneas well as list=$(ls *.tgz) for i in $list; do tar --wildcards -zxvf $i *.results.txt; done... (1 Reply)
Discussion started by: jfern
1 Replies

3. Shell Programming and Scripting

Script to unzip files and Rename the Output-files

Hi all, I have a many folders with zipped files in them. The zipped files are txt files from different folders. The txt files have the same names. If i try to find . -type f -name "*.zip" -exec cp -R {} /myhome/ZIP \; it fails since the ZIP files from different folders have the same names and... (2 Replies)
Discussion started by: pmkenya
2 Replies

4. Shell Programming and Scripting

How to move files to existing .tgz file?

Hi, I have already created the tar files. which consist of some log files and Audit.csv plz see the below code for that ================================================ tar -Pczf ARCH/${arc_date}.tgz $LOG/*.log $REYE/CEP/FiAdapter/Audit.${arc_date}.csv ... (3 Replies)
Discussion started by: pspriyanka
3 Replies

5. Shell Programming and Scripting

How to Unzip a file using unzip utility for files zipped without zip utility ?

Hi, I need to zip/compress a data file and send to a vendor. The vendor does have only unzip utility and can accept only .ZIP files. I do not have zip utility in my server. How do I zip/compress the file so that it can be deflated using unzip command ? I tried gzip & compress commands, but... (1 Reply)
Discussion started by: Sabari Nath S
1 Replies

6. Shell Programming and Scripting

How to Unzip a .ZIP file in Unix without using unzip cmd..?????

Hi All I have ftped a .ZIP file (zipped using WinZip in Windows) to my Unix server (HP-UX). I don't have unzip cmd available in my curent Unix version Please let me know any cmd in UNIX (other than unzip) using which I can unzip this .ZIP file . Please elaborate on the commands aval and... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

7. UNIX for Dummies Questions & Answers

file.tgz.1of2 & file.tgz.2of2

Hi all, Need help. Anybody seen this kind of file before? file.tgz.1of2 file.tgz.2of2 how to extract this tgz file? Any help? Tq (5 Replies)
Discussion started by: zeedwolf
5 Replies

8. UNIX for Dummies Questions & Answers

Extract .tgz files that only contain a pattern

Let's say I've got File.tgz that contains:- Apple.txt Banana.txt Carrot.txt AppleBanana.txt Now, I would like to only extract files that contain the patter "Apple". I've tried this tar -xvf File.tgz 'tar -tf File.tgz | grep 'Apple'' but it does not work. Please help. Thanks. (12 Replies)
Discussion started by: percivalwcy
12 Replies

9. UNIX for Dummies Questions & Answers

Create individual tgz files from a set of files

Hello I have a ton of files in a directory of the format app.log.2008-04-04 I'd like to run a command that would archive each of these files as app.log.2008-04-04.tgz I tried a few combinations of find with xargs etc but no luck. Thanks Amit (4 Replies)
Discussion started by: amitg
4 Replies

10. Shell Programming and Scripting

unzip particular gzip files among the normal data files

Hello experts, I run Solaris 9. I have a below script which is used for gunzip the thousand files from a directory. ---- #!/usr/bin/sh cd /home/thousands/gzipfiles/ for i in `ls -1` do gunzip -c $i > /path/to/file/$i done ---- In my SAME directory there thousand of GZIP file and also... (4 Replies)
Discussion started by: thepurple
4 Replies
Login or Register to Ask a Question