New Immissions/Updates:
boundless - educate - edutalab - empatico - es-ebooks - es16 - fr16 - fsfiles - hesperian - solidaria - wikipediaforschools
- wikipediaforschoolses - wikipediaforschoolsfr - wikipediaforschoolspt - worldmap -

See also: Liber Liber - Libro Parlato - Liber Musica  - Manuzio -  Liber Liber ISO Files - Alphabetical Order - Multivolume ZIP Complete Archive - PDF Files - OGG Music Files -

PROJECT GUTENBERG HTML: Volume I - Volume II - Volume III - Volume IV - Volume V - Volume VI - Volume VII - Volume VIII - Volume IX

Ascolta ""Volevo solo fare un audiolibro"" su Spreaker.
CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
Wikipedia:Manual of Style (command-line examples) - Wikipedia, the free encyclopedia

Wikipedia:Manual of Style (command-line examples)

From Wikipedia, the free encyclopedia

This page is part of the Manual of Style, and is considered a guideline for Wikipedia. The consensus of many editors formed the conventions described here, and Wikipedia articles should heed these guidelines. Before making any major changes to these guidelines, please use the discussion page to ensure that your changes reflect consensus.
Shortcut:
WP:MOSCOMM


Guidance on style
Manual of Style
Supplementary manuals

Abbreviations
Biographies
Capital letters
Command-line examples
Dashes
Dates and numbers
Headings
Legal
Links
Lists of works
Mathematics
Music
Pronunciation
Spelling
Text formatting
Titles
Trademarks
Writing about fiction

Special article styles

Disambiguation pages
Arabic transliteration
China-related articles
Ethiopia-related articles
Ireland-related articles
Islam-related articles
Japan-related articles
Korea-related articles
Latter Day Saints
Medicine-related articles
Portugal-related articles

Other guidance

How to edit a page
Guide to layout
Captions
Categorization
Categorization of people
Cite sources
Explain jargon
Footnotes
Writing better articles
Lead section
Lists
Music samples
Naming conventions
Overlinking
Picture tutorial
Proper names
Sections
Sister projects
Summary style
Technical terms
and definitions

Words to avoid

Command-line examples are used to specify the syntax of shell commands or programs as a user would type them into a terminal or command prompt on a computer. This page is intended to function as a style guide for writers and editors of articles related to Computer science on Wikipedia.

Contents

[edit] General guidelines

When providing command-line examples, it is necessary to maintain clarity and simplicity. Not only does this result in a more professional look, but it prevents the reader from becoming confused. The following guidelines are given to help establish what defines clear and simple examples.

  • Command-line examples should be presented in a monospaced font. The initial presentation should use the Wikipedia method that involves prefixing commands with a space. Further references should be contained in <tt> (teletype) tags.
  • Wikipedia is not a medium for the presentation of writers' personal preferences. As such, there should not be any reference to environment, date, working directory, user name, or host name unless absolutely necessary.
  • Terminology: An option is a switch (something that modifies the general behavior of the command). A parameter is a specific value, such as a file or host name. The term argument is used to refer to any of the space-separated strings that follow a command name, including both options and parameters.
  • When presenting arguments, care should be taken to maintain simplicity. Specifying them without explanation can confuse the reader.
  • Wikipedia is not a substitute for manual pages. Articles should not document the entire list of options associated with a command unless there are very few such options or such descriptiveness is absolutely necessary.
  • When specifying parameters, logical names should be used to refer to them. These names should be italicised and should not contain spaces, as spaces are used to separate multiple arguments on the command line. The following are some examples:
(prompt) command parameter-name
(prompt) command parameterName
(prompt) command parameter_name
(prompt) command parametername
  • Consistency is important. Do not confuse the reader by using all four methods of naming parameters in the same article.
  • Arguments that are not required and may be completely omitted should be enclosed within square brackets, [ and ].
  • There are many ways of specifying repeating parameters; the following two are the most common:
(prompt) command parameter0 [.. parameterN]
(prompt) command [parameter ...]

[edit] Platform-specific guidelines

[edit] DOS, Microsoft Windows, and OS/2

The most common operating system in use today is Microsoft Windows, whose command-line syntax is based on that of MS-DOS. As such, examples that might be specific to MS-DOS or Windows do not need to indicate this. However, if the examples are specific to a certain version of the operating system, then they should be indicated as such. If equivalents in other DOSes differ and are known, they should be provided.

The following additional guidelines should be followed for DOS command-line examples:

  • The names of commands and programs should be provided in all upper-case letters.
  • Standard MS-DOS–style options (of the form /C where C is some character) should also be upper-case, unless they are case sensitive.
  • Program names should be contrasted against built-in command names by appending their appropriate file extension. If a specific program is not included with certain versions of MS-DOS (such as MOVE.EXE or EDIT.COM), then the versions for which it is known to be included should be indicated.

[edit] Unix-like systems

  • Most commands on Unix-like systems are actually references to executable files. Commands that are native to a shell (such as cd or history) should be indicated as such.
  • The most common shell on Unix-like systems has varied greatly. As a result, shell-specific commands or utilities (such as the for loop or certain stream behaviors) should be avoided whenever possible.
  • If a shell-specific sequence is required for proper explanation, then an example should be provided for both the ALGOL-like sequence of sh, ksh, and bash as well as one for the C-like syntax of csh and tcsh. This is not necessary if there is no difference in the syntax.
  • The names of most commands on Unix-like systems are made up of all lower-case characters. However, due to the case-sensitive nature of the shell and operating environment, care should be taken to ensure that the capitalisation given matches that of the command or file name. Use of the wrong title template is recommended as well when necessary.
  • Commands that normally require privileged access should be differentiated from those that do not require it. If a command does require privileged access, then a disclaimer should be included indicating the risk of running commands with unrestricted privileged access.
  • In some cases, it is very likely the value of a parameter will contain some shell Meta-characters. In these cases, it may be wise to specify quoting in the example to prevent users from receiving errors that to them will seem strange and unrelated.

[edit] Providing sample output

It may often be prudent to provide a sample of the output that a command is expected to generate. In these cases, the full command and all arguments as they were typed are given. The output of the command will therefore be specific to environment and other variables. The tags <pre><nowiki> (in that order) will insure the proper formatting of the output.

[edit] Examples of usage

[edit] DOS

  • The DIR built-in command on DOS, which lists files and directories:
> DIR [options] [pattern ...]
  • The program MOVE.EXE on MS-DOS (whose behavior had to be emulated prior to its introduction):
> MOVE.EXE source target

[edit] General Unix

  • The ls command on Unix-like systems, which lists files and directories:
$ ls [options] [file ...]
  • The mkfs command, which creates new file systems and as such usually requires privileged access:
# mkfs [-t fstype] [fs-options] device
  • The wget program, one of the GNU utilities, which retrieves files given a Uniform Resource Identifier (URI). URIs can sometimes contain shell meta-characters, and so the parameter is quoted to prevent errors.
$ wget [options] "URI"

[edit] Shell-specific

  • The if built-in structure, whose syntax differs between sh/ksh/bash:
$ if command ; then command ; ... ; fi

and csh/tcsh:

% if (expression) then command ; ... ; endif

[edit] Sample output

  • Sample output of the df command, which lists disk space usage on mounted file systems:
$ df -P
Filesystem          512-blocks      Used Available Capacity Mounted on
/dev/hda2             39331760   7398904  29834768      20% /
In other languages

Static Wikipedia (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2007 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2006 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu

Static Wikipedia February 2008 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu