LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-28-2005, 01:52 AM   #1
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 59
curious: tar -xzvf ...


i always see something like
Code:
tar xzvf fluxbox-0.1.12.tar.gz
in posts and documentation, regarding the tar utility.. and can never remember the exact command.

this utility is used to compress and extract files or archives, correct?

the argument "xzvf" always gets me, and i can never remmeber it.. i looked up the command online and got what each argument means and am curious about it...

the first argument -x/--extract is always required as the first argument when extracting an archive...

"z" is used to "filter the archive through gzip".. is this only necessary for *.gz files?

"v" is for verbose, to display a list of files/directories involved.. and is probably just personal preferance, right?

"f" is apparently the option to specify the archive file... but in the documentation for this command it says that the last argument in this command is always the filename.. am i misunderstanding this? does that mean you dont need to specify -f?

the purpose of this is to basically simplify this command so i can remember it... im in windowz right now so i cant test it... but to me it looks like i can narrow down the above command to something like
Code:
tar -x fluxbox-0.1.12.tar.gz
or include the -z option also, if required for only .gz files?
 
Old 03-28-2005, 01:55 AM   #2
onelung02
Member
 
Registered: Oct 2003
Location: utah
Distribution: Slackware 10.0, Gentoo 2006.0
Posts: 289

Rep: Reputation: 30
Yea that will work, but I always like to do tar -xvf for mine, extract-verbose-force, just going x will work though. The reason that I like verbose is so that I can see where it is at in the extraction process.
 
Old 03-28-2005, 02:19 AM   #3
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
Re: curious: tar -xzvf ...

Quote:
Originally posted by nadroj
or include the -z option also, if required for only .gz files?
use j for bz2's:

tar xvfjp filename.tar.bz2
 
Old 03-28-2005, 02:29 AM   #4
Psycho(Clan)
Member
 
Registered: Mar 2005
Posts: 35

Rep: Reputation: 15
What do you think of tar -zxvf (document) to unrar it??
 
Old 03-28-2005, 03:53 AM   #5
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Quote:
Originally posted by Psycho(Clan)
What do you think of tar -zxvf (document) to unrar it??
UnTAR. Linux does not natively use RAR's.
 
Old 03-28-2005, 03:55 AM   #6
Psycho(Clan)
Member
 
Registered: Mar 2005
Posts: 35

Rep: Reputation: 15
It works with tar.gz files maybe it will work with tar.bz2 file too???
 
Old 03-28-2005, 04:02 AM   #7
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Re: Re: curious: tar -xzvf ...

Quote:
Originally posted by __J
use j for bz2's:

tar xvfjp filename.tar.bz2
 
Old 03-28-2005, 04:03 AM   #8
Psycho(Clan)
Member
 
Registered: Mar 2005
Posts: 35

Rep: Reputation: 15
so you can only do with the J??? hmm ok
 
Old 03-28-2005, 10:56 AM   #9
Padma
Member
 
Registered: Aug 2003
Location: Omaha, NE, USA
Distribution: PCLinuxOS 2007
Posts: 808

Rep: Reputation: 30
Re: curious: tar -xzvf ...

Quote:
Originally posted by nadroj
the first argument -x/--extract is always required as the first argument when extracting an archive...

"z" is used to "filter the archive through gzip".. is this only necessary for *.gz files?
Yes the "z" is only needed for tar.gz files. For tar.bz2 files, you need the "j" argument, as indicated in an earlier post.
Quote:
"v" is for verbose, to display a list of files/directories involved.. and is probably just personal preferance, right?
Yes, personal preference it is.
Quote:
"f" is apparently the option to specify the archive file... but in the documentation for this command it says that the last argument in this command is always the filename.. am i misunderstanding this? does that mean you dont need to specify -f?
So it would appear. I tried this last night on my PC at home, and when I didn't specify "f", the cursor just sat blinking at me, as if it was waiting for me to supply it with more info, even though the filename was on the command line.
YMMV
 
Old 03-28-2005, 09:52 PM   #10
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
Nobody using tar 1.15? Reading changelogs? This is the second time I've mentioned this, but if you're using a newer version of tar, you don't need 'z' or 'j'. It magic's the file type and uses the appropriate tool. You still need to know the options if you want to write backwards-compatible shell scripts but for interactive use, it's as simple as 'eXtract File' now, along with a 'v' switch or not. Also, if the switches are really a problem for anybody, I guess you could always do 'alias untargz='tar xzvf'' and 'alias untarbz='tar xjvf'' or something.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 03:48 AM
tar tar cvf - . | (cd /root/; tar xvf -) ewt3y Linux - General 10 02-19-2014 11:55 AM
Unable to use tar -xzvf with a abc.tar.gz file kakultech Linux - Software 6 11-08-2010 12:03 PM
samba install by tar xzvf wesleywest Linux - Newbie 6 11-01-2004 10:01 AM
Diferance between rpm, tar, tar.gz, scr.tar, etc mobassir Linux - General 12 08-21-2003 07:30 AM


All times are GMT -5. The time now is 08:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration