Gossamer Forum
Home : General : Perl Programming :

unzip to path

Quote Reply
unzip to path
I'm trying to unzip a file into a specific directory. It is currently being saved elsewhere- and not in the directory the zipped file was stored in.

tar -zxf /path/to/file/filename.tar PREFIX=/path/to/file/unzipped

but it is not working. Is there a correct command?

Quote Reply
Re: [Alba] unzip to path In reply to
Is this in a perl script, or from command line?

If so, you *may* need; (NB, I've never used this myself, as most of the invokation stuff I do is in the directory I wanna decompress in =));

-C, --directory=DIR change to directory DIR

So something like;

tar -xof --directory=/path/to/decompress/in/ file.tar

As I said, this isn't something I use normally =D (appologies if its wrong, I'm still getting over the flue <G>).

Hope that helps

Andy (mod)
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] unzip to path In reply to