LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-23-2008, 01:40 AM   #1
curos
Member
 
Registered: Aug 2003
Distribution: Slackware
Posts: 72

Rep: Reputation: 15
`man tar` examples question - why two v's?


When you man tar, it gives some examples of common uses of tar to extract and compress files together. But why do all of the examples include the option 'v' twice?

Here's a link to the man tar online and the examples it gives is below:

Code:
       tar -xvvf foo.tar
	      extract foo.tar

       tar -xvvzf foo.tar.gz
	      extract gzipped foo.tar.gz

       tar -cvvf foo.tar foo/
	      tar contents of folder foo in foo.tar
So why is the parameter 'v' there twice?
 
Old 11-23-2008, 01:53 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
to make it twice as verbose. You don't seem to have even confirmed what the v means. if you did it would have probably been self explanatory.
 
Old 11-23-2008, 01:55 AM   #3
kevinalm
Member
 
Registered: Oct 2003
Location: Iowa
Distribution: LFS 5.0, building 6.3, win98se, multiboot
Posts: 288

Rep: Reputation: 30
Many linux commands accept more than one v. Basically, it makes the command more verbose (more chatter ). For some commands this is very usefull, lspci -vv gives a lot more info about the pci hardware than lspci -v . Iirc, you can go lspci -vvv and get several pages worth, instead of a dozen lines or so with lspci -v .
 
Old 11-23-2008, 02:11 AM   #4
curos
Member
 
Registered: Aug 2003
Distribution: Slackware
Posts: 72

Original Poster
Rep: Reputation: 15
You're right, I should have tried it out. I just tried it out right now and it was self explanatory.

But that also gets me curious as to whether there are any other common parameters that take the same letter more than once?

Thanks kevinalm and acid_kewpie!
 
Old 11-23-2008, 02:20 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
it's normally only that or -d for debug when applicable. there will be others, but I can't recall any others from other commands off hand.
 
Old 11-24-2008, 04:44 PM   #6
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
ps accepts multiple -w flags to allow for returns that are wider than the screen resolution, to increasing degrees (my most common use of this is ps auxwww | grep (something))
 
Old 11-24-2008, 06:21 PM   #7
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
All the commands do have a man page or an info page where you can read all options.

Sometimes you will find that both (man and info) are present, but only one of them has all the info and is updated regularly. In the case of tar, the author decided that that would be the info page, so, in "info tar" you can read this:

Code:
`--verbose'
`-v' 
     Specifies that `tar' should be more verbose about the operations
     it is performing.  This option can be specified multiple times for
     some operations to increase the amount of information displayed.
While the tar page has a lot less information. So, if man doesn't give enough info, you can look for an info page, or vice-versa.
 
Old 11-24-2008, 07:32 PM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
I'm reminded of the statement about the suffixes to the SED "s" command: You can combine them "where it makes sense".

There are many examples where is it obvious that doubling up on the flags does NOT make sense. eg "ls -RR" makes no sense, nor does "grep -ee".

My rule is to first keep it simple, and second to go to the man page to figure out how to do one specific thing. Reading man pages for all the possibilities is not going to have a high return on investment.
 
  


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
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 11:02 AM
simple tar question can not find answer in man file davimint Linux - General 3 05-22-2007 01:03 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
Linux v's Windows oberon-ken-obi General 8 03-09-2005 11:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:39 AM.

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