Jump to content

Template:Commands: Difference between revisions

From NixOS Wiki
DoggoBit (talk | contribs)
No edit summary
DoggoBit (talk | contribs)
No edit summary
 
Line 1: Line 1:
<noinclude>{{Documentation}}</noinclude><includeonly><pre<noinclude></noinclude>
<includeonly>{{code|{{{1}}}|lang=shell}}</includeonly><noinclude>{{delete|It is functionally the same as {{template link|code}} with <code>shell</code> as the language parameter.}}{{Documentation}}</noinclude>
  style="{{META Commands Style}}"
>{{{code|{{{1|{{META Error}}}}}}}}</pre<noinclude></noinclude>></includeonly><noinclude><!-- The &lt;noinclude>&lt;/noinclude> hack is needed to allow wiki markup inside the pre tags; reference: http://www.gossamer-threads.com/lists/wiki/mediawiki/118688#118688 --></noinclude>

Latest revision as of 20:47, 5 June 2025

✖︎︎
This article is a deletion candidate. Further information may be found on the related discussion page.

Template Documentation [edit source| uses| help]

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
}}
{{Commands|$ cat /proc/cpuinfo {{!}} grep '^model name' {{!}} head -n1}}
{{Commands|<nowiki>
# Disregard useless use of cat
$ cat /proc/cpuinfo | grep '^model name' | head -n1
</nowiki>}}

Example

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