Topic "Commands to Decompress TGZ archive"

Author Message
minorgod
[View user's profile]

Joined: 2004-03-26
Posts: 4
Location: Tallahassee, FL
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.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
There should be some switch before the destination path, should not? Like:

tar -xvzf --directory="!?&Extract to which directory:?.!" "!"
_________________
Martin Prikryl
minorgod
[View user's profile]

Joined: 2004-03-26
Posts: 4
Location: Tallahassee, FL
prikryl 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.
Emagin

Guest


I can't get this to work
I tried to tar|gzip an archive using the built in script:
Code:
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:
Code:
tar -xvzf --directory="!?&Extract to which directory:?.!" "!"


I get the following error:
Code:
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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
You tar tool may not support --directory option. Try to remove it.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License