LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to use man pages (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-use-man-pages-590785/)

babu198649 10-10-2007 09:13 AM

how to use man pages
 
hi
There are many options for a command in man pages .some options come inside [] and some with extensions - or -- .is it necessary to use the first occuring option before using the next.
thanks

farslayer 10-10-2007 09:28 AM

I usually read a man page and then search Google for examples if I'm still unsure of how a command should be issued.

man grep
examples using grep

A bit of creative searching on Google will usually clear up your questions on a command enough to get you moving.

If you are into books at all, one I might recommend for you is theLinux Phrasebook It's chock full of commands and examples of how they are used indexed by task rather than just the name of the command which you may not know... A compact reference that is reasonably priced. Google books has an excerpt from this book


just remember the more difficult of items still don't have manuals, you'll have to figure out those items on your own..
Quote:

username@it-etch:/var/www$ man woman
No manual entry for woman
:)

matthewg42 10-10-2007 09:48 AM

Quote:

Originally Posted by babu198649 (Post 2919661)
some options come inside []

That means they are not required, but optional.

Quote:

Originally Posted by babu198649 (Post 2919661)
and some with extensions - or -- .

The single - before a single character option is the original unix style. Often with this style of option you an "bundle" options together too, for example, these two variations do the same thing - the second is with bundling:
Code:

grep -i -v
grep -iv

The more recent convention of using --long-options is described in detail in the GNU coding standards document. One of the reasons for adopting this style was to improve readability and memorability of options. It's easy to get confused between a --long-option and short-option bundling. If a program supports both, you might find something where all the following do the same thing:
Code:

program --verbose --yes
program --verbose -y
program -v --yes
program -v -y
program -vy

Note that the --yes is distinguishable from -yes only by the double hyphen. -yes would presumably be interpreted as a bundled version of -y -e -s, if those options existed.

Quote:

Originally Posted by babu198649 (Post 2919661)
is it necessary to use the first occuring option before using the next.

Generally not for options. For arguments which are not options (i.e. do not have a - or -- at the start) the order often is important. For example, the cp (file copy) command, these two commands do the same thing:
Code:

cp -i -p somefile anotherfile
cp -p -i somefile anotherfile

But these two commands do a different thing - one which you probably don't want to get wrong:
Code:

cp -i -p somefile anotherfile
cp -i -p anotherfile somefile

Processing the command line options is the job of the program itself, and as such it is the responsibility of the programmer to do so in a manner which is consistent with other programs. There is the odd program which breaks the accepted conventions. In my experience these tend to be the same ones that do not provide manual pages, or other good documentation, and they are often annoying to use.

whk 10-10-2007 11:02 AM

BTW, peruse less on how to navigate through out man.
$ man less

baikonur 10-10-2007 11:12 AM

another nice.to.know:
Code:

man -k sex
to search for man pages about programs that have anything to do with sex.

Pau Gasol 10-10-2007 11:24 AM

Another "linux Phrasebook" recomendation here :)

You can get the book cheap and it really shows you some command line key commands. Nice job by the writer.

babu198649 10-11-2007 12:13 AM

to farslayer
 
Thank you very much farslayer for u r quick response .actually this is my first question and i never expected sucha a quick replay.

babu198649 10-11-2007 12:20 AM

to matthewg42
 
hi matthewg42 thanks for u r detailed explanation .the greatest thing u have done regarding my question is u have understood perfectly what i wanted to say.
Also u have mentioned about GNU coding standards document .can u tell me where can i find them.

matthewg42 10-11-2007 06:28 AM

Quote:

Originally Posted by babu198649 (Post 2920439)
hi matthewg42 thanks for u r detailed explanation .the greatest thing u have done regarding my question is u have understood perfectly what i wanted to say.
Also u have mentioned about GNU coding standards document .can u tell me where can i find them.

The section you want is here.

babu198649 10-11-2007 07:09 AM

thanks again

one more question.i am using fedora.i want to know about the version and using the following command i got the result below .why there is no information regarding fedora.


uname -a
Linux localhost.localdomain 2.6.21-1.3194.fc7 #1 SMP Wed May 23 22:47:07 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux

baikonur 10-11-2007 07:19 AM

Code:

man uname
:)

jschiwal 10-11-2007 07:27 AM

A nice way to read man pages is to enter "man:topic" in konqueror. Sometimes you might want a hardcopy printout: man -t topic | lpr

matthewg42 10-11-2007 10:28 AM

Quote:

Originally Posted by jschiwal (Post 2920733)
A nice way to read man pages is to enter "man:topic" in konqueror. Sometimes you might want a hardcopy printout: man -t topic | lpr

Wow, I didn't know that about konqueror. Is there anything it doesn't do?!

colucix 10-11-2007 10:41 AM

Quote:

Originally Posted by babu198649 (Post 2920716)
one more question.i am using fedora.i want to know about the version

Code:

cat /etc/fedora-release

chrism01 10-12-2007 02:14 AM

That uname output finishes with 'fc7' => fedora core 7 :)


All times are GMT -5. The time now is 04:13 PM.