#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    56
    Rep Power
    4

    Batch extract contents of folder in .tgz files


    I'd like to extract lots of .tgz files, well a particular folder inside the tgz into folder (overwriting files if the source is newer than target). Is there a command I can use, or a program that will do this efficiently?

    thanks
  2. #2
  3. Contributed User
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Jun 2005
    Posts
    4,407
    Rep Power
    1871
    Use a for loop
    Say something like
    for %i in ( *.tgz ) do echo %i

    If you know what command (in this example echo) you want to apply to one file, then this will efficiently apply the same thing to all tgz files.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2011
    Posts
    56
    Rep Power
    4
    Do you mean I should write a program to do this? I'm not sure how to look inside a tgz file to extract the folder and to set it to only overwrite if newer

IMN logo majestic logo threadwatch logo seochat tools logo