LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 06-04-2004, 05:57 PM   #1
Utah
Member
 
Registered: Apr 2004
Distribution: Fedora Core 3
Posts: 73

Rep: Reputation: 15
What are those double-dash (--) options in man?


When I look at man pages, most commands seem to have some options listed with a double dash "--" in front of them.

For instance, man rpm lists options:

--quiet Print as little as possible
-v Verbose

Why does the Verbose option use one dash but the Quiet option use two?


Thanks in advance,

Utah
 
Old 06-04-2004, 06:10 PM   #2
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
As far as I can tell, switches that use a letter (like -a) only need a dash, but those that use a word, don't. But I have no idea why - probably something from Unix.
 
Old 06-04-2004, 06:19 PM   #3
darthtux
Senior Member
 
Registered: Dec 2001
Location: 35.7480° N, 95.3690° W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
They are gnu additions to the options to make some of them clearer. The man pages in Slackware make a distinction between industry standard POSIX options and the gnu ones each being under their own section.
 
Old 06-04-2004, 06:23 PM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
You live and learn
 
Old 06-04-2004, 10:53 PM   #5
Tino27
Member
 
Registered: Aug 2003
Location: Akron, OH
Distribution: Slackware 14.2-stable, Ubuntu 16.04 LTS
Posts: 401

Rep: Reputation: 30
I think additionally that single character options can be strung together on a single '-'.

For example...

tar -xvzf source.tar.gz

instead of (but is functionally the same as)

tar -x -v -z -f source.tar.gz

'--' options are actually single options that are more than one letter.

So...

tar --xvzf source.tar.gz

would actually force the tar program to look for a single option named 'xvzf'.

You can also mix and match, such as

ls -al --co

which will list all (-a) of the contents of the current directory in long (-l) format and apply color (--co) to the display based on the type of file listed on the screen.

Hope that helped.
 
  


Reply



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
Double the desktop, not double the fun! bizshop SUSE / openSUSE 3 08-26-2005 12:22 PM
dash every time I hit enter in gnome (rh9) in everything lynchmob09 Linux - General 2 09-22-2003 05:26 PM
dash every time i hit enter (carriage return) in gnome (rh 9) lynchmob09 Linux - Software 1 09-18-2003 12:38 AM
Red Hat 8 Dash Character meshcurrent Linux - General 3 02-20-2003 12:51 AM
Compiling packages on RH 7.1 causes man files to be named man.gz mmboam Linux - General 0 05-09-2001 06:47 PM

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

All times are GMT -5. The time now is 09:48 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
Open Source Consulting | Domain Registration