uncompress a group of files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting uncompress a group of files
# 1  
Old 09-05-2008
uncompress a group of files

i have some 100's of files in the format .tar.gz. how to uncompress them in a single shot

i have sorted the files according to current date and now they reside in a dir called naveed1.

cd naveed1

ls -ltr

file1.tar.gz
file2.tar.gz
:
:
:
file100.tar.gz

how to uncompresse them in single shot in the current dir i.e. naveed1
# 2  
Old 09-05-2008
try :

Code:
 gunzip *.gz


Last edited by dennis.jacob; 09-05-2008 at 02:48 AM..
# 3  
Old 09-05-2008
i mean to say even uncompress tar so the files in dir naveed1 should be

file1
file2
file3
:
:
:
file100
# 4  
Old 09-05-2008
find . -type f -name "file*.tar.gz" -exec gunzip {} \;
# 5  
Old 09-05-2008
Code:
for f in *.tar.gz ; do gunzip -c $f | tar xvf - ; done

# 6  
Old 09-05-2008
Quote:
Originally Posted by dennis.jacob
try :

Code:
 gunzip *.gz

Try this for uncompress and extract

Code:
gunzip *.gz | tar -xvf -

Some unix versions even support

tar -xzvf ".tar.gz*"
# 7  
Old 09-05-2008
Thanks got it by the below command

for f in *.tar.gz ; do gunzip -c $f | tar xvf - ; done

Last edited by ali560045; 09-05-2008 at 03:00 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Replace Stub Values In One Group Of Files With Actual Values From Another Group Of Files

I have two directories of files (new-config-files and old-config-files): new-config-files/this-db/config.inc.php new-config-files/that-db/config.inc.php new-config-files/old-db/config.inc.php new-config-files/new-db/config.inc.php new-config-files/random-database/config.inc.php etc. ... (4 Replies)
Discussion started by: spacegoose
4 Replies

2. Shell Programming and Scripting

Uncompress several tar.gz files inside several folders

Hi, I need to uncompress sevral tar.gz files that are located insides sevral folders using a shell script. Folder tree looks like this : /folder/001 /folder/002 /folder/003 Inside each folder dossier (001,002,003) we can find 1 or several tar.gz files. I've scripted something... (9 Replies)
Discussion started by: shellX
9 Replies

3. HP-UX

[Solved] how to compress and uncompress the files beween HP UX and Linux OS

I have file with large size in HP-UX os. I need to compress on HP-UX and ftp to linux server and i need to uncompress the files. How can i do this? Any help is highly appreciated.. (3 Replies)
Discussion started by: govindts
3 Replies

4. Shell Programming and Scripting

uncompress tar.gz files

i Have 150 tar.gz files and i need to uncompress and extract all the files from those 150 tar.gz and i will have 150 files on daily basis. could any one help me out with the script to uncompress tar.gz files. (5 Replies)
Discussion started by: gaddamshashank
5 Replies

5. Shell Programming and Scripting

Shell script required to uncompress and untar files

I need a shell script to Uncompress untar all the files present in the directory (it should Uncompress an untar files present in its sub folders also) In my work I get lots of tar files to untar and update the server, for this each time in need to type Step1) “ Uncompress xyz1-3.tar.z”... (2 Replies)
Discussion started by: arewe
2 Replies

6. Shell Programming and Scripting

Listing uncompress and compress files

How can i list uncompress files and compress those and also vice versa suppose im listing the compressed files as ls -ltr *.Z. how can i list the uncompressed files using not *.Z. (1 Reply)
Discussion started by: laknar
1 Replies

7. HP-UX

uncompress of PKZIP files on HPUX

Hi All, is there any command to unzip the compressed files compressed using PKZIP on HP-UX. We dont have unzip. and gunzip or compress commands are not working. is there any other to do this? Thank you very much for the help. Regards, Srinivas (3 Replies)
Discussion started by: srinivas_paluku
3 Replies

8. Shell Programming and Scripting

How to uncompress zip files in a remote server from a script

Hi UNIX gurus, the scenario is that i have written a script which takes as input a directory structure. And after that a tar is made ,then zipped and FTP it to a server.But how do i uncompress it from my script as FTP doesnot support any uncompress command during FTP session. I have to automate... (2 Replies)
Discussion started by: rahul26
2 Replies

9. UNIX for Dummies Questions & Answers

uncompress files

I get a compressed file for linux and I want to uncompress it in Unix. Is that possible? I try with te command uncompress but it didnīt work. T.hanks (3 Replies)
Discussion started by: diegoe
3 Replies

10. UNIX for Dummies Questions & Answers

uncompress pkzip files

Are there any unix/linux tools that can uncompress the "pkzip" files from DOS env. Thanks . (2 Replies)
Discussion started by: Wing m. Cheng
2 Replies
Login or Register to Ask a Question