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 Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
deleting files after the creation of a tar archive Minguccio75 UNIX for Advanced & Expert Users 5 02-13-2007 06:26 AM
Archive script old files kayarsenal Shell Programming and Scripting 1 08-25-2006 01:46 AM
Archive files kayarsenal Shell Programming and Scripting 13 08-21-2006 11:01 AM
Archive files older than 30days dsravan Shell Programming and Scripting 8 07-26-2006 04:52 PM
script to archive all the log files tintedwindow Shell Programming and Scripting 0 06-13-2006 10:51 PM

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 08-04-2005
Kun2112 Kun2112 is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 2
tar archive with .Z files

Hello,
I have a tar archive full of compressed .Z (compressed with the compress command) files. I have restored the tar to a disk but am looking for a way to uncompress every file in every sub-directory. Under normal circumstances, I would just change directories and "uncompress *" but with 1600 total directories, I was hoping that there would either be a switch for uncompress that would do all recursive sub-directories or that a tar switch exists that will uncompress upon restore (ie: tar -xvf? ).
I am running this on Kornshell/cshell emulator for XP. (Don't hate me for using M$)
  #2 (permalink)  
Old 08-04-2005
locustfurnace locustfurnace is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2004
Posts: 232
Have you tried using the shell to accomplish what you need.

for example:

foreach i (*/*.Z)
uncompress $i
end



This will descend 1 level into a directory and uncompress the file.
  #3 (permalink)  
Old 08-05-2005
Unbeliever Unbeliever is offline
Registered User
  
 

Join Date: Jul 2005
Location: England
Posts: 183
find <dirname> -name \*.Z -exec uncompress {} \;

Where <dirname> is the top level of where all your compressed files are.

If you dont have access to find then its possible to do it quickly using the same basic command for each level of dir present.

uncompress *.Z
uncompress */*.Z
uncompress */*/*.Z
etc ...

Otherwise you need a lslightly awkward shell script to recurse into and uncompress all the files.
  #4 (permalink)  
Old 08-05-2005
Kun2112 Kun2112 is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 2
Thanks for the suggestions, still pretty new to this OS, but learning nor every day.
Sponsored Links
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 07:01 AM.


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