5

I am trying to get better about using documentation to understand command syntax but I realized I don't fully understand the symbols used which show all the options and parameters that can be passed to command.

For example man zip:

SYNOPSIS

   zip  [-aABcdDeEfFghjklLmoqrRSTuvVwXyz!@$] [--longoption ...]  [-b path]
   [-n suffixes] [-t date] [-tt date] [zipfile [file ...]]  [-xi list]

Or man bzip2:

SYNOPSIS
       bzip2 [ -cdfkqstvzVL123456789 ] [ filenames ...  ]
       bzip2 [ -h|--help ]
       bunzip2 [ -fkvsVL ] [ filenames ...  ]
       bunzip2 [ -h|--help ]
       bzcat [ -s ] [ filenames ...  ]
       bzcat [ -h|--help ]
       bzip2recover filename

Is there a resource which goes over how to read this syntax and can tell me what each symbol means?

1
  • 1
    You just have to scroll down to see what each of those symbols mean.. also read this – Ron Jul 19 '15 at 17:24
3

A good resource is this (I have copied shamelessly)


One of the hardest parts of unix for beginners is finding documentation. When you hear the system comes with an online manual, it usually causes a sigh of relief. What you don't know is that manual pages are technical references. While that may sound really bad -- its not! Once you learn the basics of man pages, you will come to appreciate how they are written. If you need information, and don't have time to waste, the man command is who you turn to.

This document attempts to teach you how to read the unix manual -- commonly refered to as the man pages. Common Quotes

Before we jump into our first man page, lets take a look at some common symbols used in them. These symbols are sometimes refered to as quotes.

The primary use of a man page is to lookup parameters for a program. Since most parameters are optional, they will be enclosed in square brackets.

[optional]
[-abcgln]

Some options will have a limited list of choices. A list of choices will be comma seperated and put between braces.

{choice1,choice2}
{yes,no}

Many sources of help documentation enclose manditory parameters between less-than/greater-than symbols.

<manditory>
<program_name>

While the above manditory quotes aren't usually used in man pages, its a good thing to know.

2
  • Nice! Thanks! I will take a look at this more in depth tomorrow but it looks like it describes exactly what I was looking for – timbram Jul 19 '15 at 20:39
  • 1
    @timbram: If this answer helped you, don't forget to click the grey at the left of this text, which means Yes, this answer is valid! ;-) – Fabby Jul 20 '15 at 23:17
0

From man man page :


The following conventions apply to the SYNOPSIS section and can be used as a guide in other sections. man synopsis description

Exact rendering may vary depending on the output device. For instance, man will usually not be able to render italics when running in a terminal, and will typically use underlined or coloured text instead.

The command or function illustration is a pattern that should match all possible invocations. In some cases it is advisable to illustrate several exclusive invocations as is shown in the SYNOPSIS section of this manual page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.