






السمعة:
قسم ال
Synopsis
أو الشرح أو التلخيص من اهم الأقسام في ال man
pages فهو القسم اللي بيساعدك تفهم ازاي بنستخدم الأمر دهThe
For example, consider an example
SYNOPSIS
section of a man page can be difficult to understand, but it is a valuable resource since it provides a concise example of how to use the commandFor example, consider an example
SYNOPSIS
for the cal
command
كود:
SYNOPSIS
cal [-3hjy] [-A number] [-B number] [[month] year]
The square brackets
The second set of square brackets
The third set of square brackets in the
The fourth set of square brackets in the
Another component of the
[ ]
are used to indicate that this feature is not required to run the command. For example, [-3hjy]
means you can use the options -3
, -h
, -j
, -y
, but none of these options are required for the cal
command to function properlyThe second set of square brackets
[-A number]
allows you to specify the number of months to be added to the end of the displayThe third set of square brackets in the
[-B number]
allows you to specify the number of months to be added to the beginning of the displayThe fourth set of square brackets in the
[[month] year]
demonstrates another feature; it means that you can specify a year by itself, but if you specify a month you must also specify a yearAnother component of the
SYNOPSIS
that might cause some confusion can be seen in the SYNOPSIS
of the date
command
كود:
SYNOPSIS
date [OPTION]... [+FORMAT]
date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
In this
The ellipses
Additionally, the
SYNOPSIS
there are two syntaxes for the date
command. The first one is used to display the date on the system while the second is used to set the dateThe ellipses
...
following [OPTION]
, indicate that [OPTION]
may be repeatedAdditionally, the
[-u|--utc|--universal]
notation means that you can either use the -u
option or the --utc
option, or the --universal
option. Typically, this means that all three options really do the same thing, but sometimes this format (use of the |
character) is used to indicate that the options can’t be used in combination, like a logical orتلخيصا للشرح في صورة سؤال وجواب
I have not been able to understand the SYNOPSIS section in the manpage of a command. For example, let’s see the manpage ofman
itself. Byman man
:
كود:
SYNOPSIS
man [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L
locale] [-m system[,...]] [-M path] [-S list] [-e extension] [-i|-I]
[--regex|--wildcard] [--names-only] [-a] [-u] [--no-subpages] [-P
pager] [-r prompt] [-7] [-E encoding] [--no-hyphenation] [--no-justifi‐
cation] [-p string] [-t] [-T[device]] [-H[browser]] [-X[dpi]] [-Z]
[[section] page ...] ...
man -k [apropos options] regexp ...
man -K [-w|-W] [-S list] [-i|-I] [--regex] [section] term ...
man -f [whatis options] page ...
man -l [-C file] [-d] [-D] [--warnings[=warnings]] [-R encoding] [-L
locale] [-P pager] [-r prompt] [-7] [-E encoding] [-p string] [-t]
[-T[device]] [-H[browser]] [-X[dpi]] [-Z] file ...
man -w|-W [-C file] [-d] [-D] page ...
man -c [-C file] [-d] [-D] page ...
man [-hV]
- Does the SYNOPSIS section describe the syntax for the command?
- what do those
[...]
and[...]
inside[...]
mean? Do they mean something optional? - Does
|
mean OR? - What does
,
mean in[-m system[,...]]
? - Does the SYNOPSIS section follow the rules used for Regular Expressions?
- The synopsis section usually gives some example use-cases. Sometimes sub-commands have different options, so several examples might be shown.
- Brackets
[]
always denote optional switches, arguments, options, etc.- Yes, the pipe
|
means or, particularly when inside brackets or parenthesis.- Brackets in brackets just means that the second part is dependent on the first, and also itself optional. Some switches you can use on their own or add a value to them. Commas at the start of a bracket would indicate there can be multiple comma separated values.
- They lean on Regex concepts, but are meant to be human readable so don’t follow all the escaping rules etc.
The following conventions apply to the SYNOPSIS section and can be used as a guide in other sections
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
وكده انت دلوقتي تقدر تقرأ اي man page وتفهم اي امر تستخدمه ازاي

التعديل الأخير: