Commands to Decompress TGZ archive

Advertisement

minorgod
Joined:
Posts:
4
Location:
Tallahassee, FL

Commands to Decompress TGZ archive

Extract to current directory:
tar -xvzf "!"

Extract with Prompt for target directory:
tar -xvzf "!?&Extract to which directory:?.!" "!"

The prompt is set to default to the current directory, but I'm not sure the syntax is correct because it's not working when I specify a "." for the current directory. Maybe I'm missing something?
_________________
Nowhere does science promise emancipation.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,317
Location:
Prague, Czechia

Re: Commands to Decompress TGZ archive

There should be some switch before the destination path, should not? Like:

tar -xvzf --directory="!?&Extract to which directory:?.!" "!"
_________________
Martin Prikryl

Reply with quote

minorgod
Joined:
Posts:
4
Location:
Tallahassee, FL

Re: Commands to Decompress TGZ archive

martin wrote:

There should be some switch before the destination path, should not? Like:

tar -xvzf --directory="!?&Extract to which directory:?.!" "!"

That's probably it...from the Linux docs I read, it wasn't too clear.
_________________
Nowhere does science promise emancipation.

Reply with quote

Emagin
Guest

Not working

I can't get this to work
I tried to tar|gzip an archive using the built in script:
tar -c -j -f "!?&Archive Name:?archive.tar.bzip2!" !&

The result was archive.tar.bzip2
I can open this with windows 7-zip fine.

Then I try the script mentioned above to untar|zip it using this:
tar -xvzf --directory="!?&Extract to which directory:?.!" "!"

I get the following error:
Command 'tar -xvzf --directory="." "archive.tar.bzip2"'
failed with return code 2 and error message
tar (child): --directory=.: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Child returned status 2
tar: archive.tar.bzip2: Not found in archive
tar: Error exit delayed from previous errors.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,317
Location:
Prague, Czechia

Re: Not working

You tar tool may not support --directory option. Try to remove it.
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum