Template:Commands: Difference between revisions

From NixOS Wiki
imported>Samueldr
Created page with "<noinclude> {{Template}} {{DISPLAYTITLE:Template:commands}} ===Special note=== The pipe character '''cannot''' be used as is within the template, as it is a special character..."
 
imported>Samueldr
No edit summary
Line 2: Line 2:
{{Template}}
{{Template}}
{{DISPLAYTITLE:Template:commands}}
{{DISPLAYTITLE:Template:commands}}
===Special note===
{{META Pipe Character}}
 
The pipe character '''cannot''' be used as is within the template, as it is a special characters for templates.
 
It can be included [https://www.mediawiki.org/wiki/Help:Magic_words#Other using the magic word <code><nowiki>{{!}}</nowiki></code>].
 
Alternatively, it is possible to instead surround the commands in <code><nowiki><nowiki></nowiki></code> tags.


===Usage===
===Usage===

Revision as of 01:04, 6 September 2017

This page is a template. It should be used as part of other articles. For more information, see Help:Template.

Please do not experiment with this template; you could ruin all pages using this template. If you want to edit this template, copy the text to Template:Sandbox, edit and test it there, and copy it back when it works.

Feel free to discuss this template in the talk page.

If you wanted to create a new page instead, use the search box to search for the title of the new page you want to create and follow the link Create the page "XYZ" on this wiki! in the results page. An alternative is to create a dangling link to the new page from an existing page. A final option is to directly visit the expected URL of the page.


Special note

The pipe character cannot be used as is within the template, as it is a special characters for templates.

It can be included using the magic word {{!}}.

Alternatively, it is possible to instead surround the contents in <nowiki> tags.

Usage

Take care of always aligning the $ to the left.

{{Commands|$ command-not-found}}
{{Commands|
$ command-not-found
$ other-command
}}

Example

$ command-not-found
$ command-not-found
$ other-command

Example with wrong alignment

$ command-not-found
 $ other-command
$ final-command

Escaping pipe

Look at the source to see usage.

$ cat /proc/cpuinfo | grep '^model name' | head -n1
# Disregard useless use of cat
$ cat /proc/cpuinfo | grep '^model name' | head -n1