LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   command tar: - ? gunzip or no ? (https://www.linuxquestions.org/questions/linux-newbie-8/command-tar-gunzip-or-no-310390/)

eeried 04-06-2005 11:21 AM

command tar: - ? gunzip or no ?
 
Hello,

I'm rather intrigued about the following two points:

1. tar command

Both
Code:

tar -xzvf *tar.gz
and
Code:

tar xzvf *tar.gz
can be found instructions on Web pages?

Which is better - or no - before the xzvf string?

Both seem to work fine (tested with firefox and thunderbird tar.gz files).

2. On the mozilla.org web site (mozilla suite section) they have these instructions for the tar.gz file

Code:

gunzip -dc moz*.tar.gz | tar -xvf -
Is this quite the equivalent of the simpler:
Code:

tar -xzvf *tar.gz
Both seem to have the same effect.

Are there old-fashioned commands or signs that are no longer needed now?



:study:

reddazz 04-06-2005 11:29 AM

There are so many ways of doing the same thing, so the Mozilla command works the same way as the short one. :) I have always used the - before zxvf when extracting files so I never knew extraction worked without it.

bigrigdriver 04-06-2005 11:52 AM

Just a few years ago, the switch ( - ) was required before the tar options. Tar has been upgraded, and the switch is no longer required; it is now optional.

Komakino 04-06-2005 12:51 PM

Quote:

Originally posted by bigrigdriver
Just a few years ago, the switch ( - ) was required before the tar options. Tar has been upgraded, and the switch is no longer required; it is now optional.
In the latest version of tar you don't even need the z or j flag to specify whether the archive is gzip or bzip2 compressed. Just tar xf filename.gz/bz2 will work!

eeried 04-06-2005 12:59 PM

Many thanks all for your replies, and for bringing me up to date.

Cheers,


;)


All times are GMT -5. The time now is 03:47 AM.