[X-Unix] zip from command-line in Tiger

Rod Buchanan lists at sofstats.com
Wed Jun 29 20:23:03 PDT 2005


On 6/29/05 2:43 PM, "David Ledger" <dledger at ivdcs.demon.co.uk> wrote:

>> I'm looking at tar now and the only problem is its insistence upon
>> putting the directory structure in. I found the -C option, but short
>> of manually building the tar archive file by file, is there any way
>> to tell it to create an archive with all the listed files, without
>> placing them in a copy of the directory hierarchy? I.e. so that when
>> uncompressed you end up with a folder that contains all the files
>> directly in it, regardless of their original locations? None of the
>> options looks like it does this, but I want to be sure I'm not
>> missing something obvious. The only way I can think to do this, then,
>> would be a separate tar command for each file, using -c for the first
>> one and -r for subsequent ones, each time using -C to go to the
>> directory of the file before adding it. Is there a better way?
> 
> It's designed not to work that way because it's so rarely what is
> wanted. In over 20 years of tar use I've never wished it did that.

Look at the "pax" command ("man pax").  You can use the -s option to strip
the paths from the file names.

-- 
Rod

Windows NT crashed.
      I am the Blue Screen of Death
No one hears your screams.

   -- Salon Haiku Contest, 1998



More information about the X-Unix mailing list