AI助手支持GPT4.0
Blog Terminal generates a terminal-like box that you can use to demonstrate terminal output or show the entry of terminal/console commands in a manner that is more demonstrative of actually using a Linux/Unix terminal or Windows cmd shell.
Blog Terminal会生成一个类似于终端的框,您可以用它来演示终端输出或显示Terminal / Console命令的输入,这种方式更能说明实际使用Linux / Unix终端或Windows cmd Shell的情况。 p
p>
>
The code is a fork of Post Terminal, which is a fork of WP-Terminal which in turn is a modification of WP-Syntax, a source code highlighter plugin for WordPress.
代码是Post Terminal的分支,而Post Terminal是WP-Terminal的分支,而WP-Terminal则是WP-Syntax的修改版,WP-Syntax是WordPress的源代码荧光笔插件。
Unlike Post terminal, it uses [terminal] shorthand for the terminal box.
[terminal]
与Post终端不同,它使用 [terminal] code>简写作为终端盒。It also shows prompt only on lines explitly set to do that.它还仅在明确设置的行上显示提示。 p>Basic Usage基本用法 h4>The most basic usage is to wrap your terminal blocks with [terminal][/terminal] tags.最基本的用法是用 [terminal] [/ terminal] code>标签包装接线盒。If no further options are defined within the tag a generic prompt is generated using ‘user@computer’ with no working directory shown.如果标记中未定义其他选项,则会使用“ user @ computer”生成通用提示,但不会显示工作目录。This is similar to exporting PS1=”\u@\h:$ ” in sh(1), setting prompt=”%n@%m:$ ” in csh(1), etc.这类似于在sh(1)中导出PS1 =” \ u @ \ h:$”,在csh(1)中设置提示符=“%n @%m:$”,等等。Other options available within the tag are user=”user”, computer=”computer”, and cwd=”/path/to/directory”.标签内可用的其他选项是user =“用户”,computer =“计算机”和cwd =“ / path / to / directory”。These allow you to override the generic user@computer settings as well as provide a ‘current working directory’.这些使您可以覆盖常规的user @ computer设置,并提供“当前工作目录”。The prompt is only shown on the lines starting with ‘$ ‘.提示仅显示在以“ $”开头的行上。So you can mix commands with simulated terminal output.因此,您可以将命令与模拟终端输出混合使用。 p>Usage用法 h3>Wrap terminal blocks with [terminal user="username" computer="computername" cwd="/path/to/directory"] and [\terminal].用 [终端用户=“用户名” computer =“计算机名” cwd =“ /路径/目标目录”] code>和 [\ terminal] code>包裹接线盒。They are all optional.它们都是可选的。“user” and “computer” will be shown if you don’t provide them, cwd is purely optional.如果您不提供“用户”和“计算机”,则会显示出来,cwd完全是可选的。 p>Example 1: No customized command 示例1:无自定义命令 strong> p>[terminal] [终端]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 2: User and computer customizations 示例2:用户和计算机自定义 strong> p>[terminal user="tux" computer="linux"] [终端用户=“ tux” computer =“ linux”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 3: Customizing just the user 示例3:仅自定义用户 strong> p>[terminal user="dak"] [终端用户=“ dak”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 4: Customizing user, computer and displaying a working directory 示例4:自定义用户,计算机并显示工作目录 strong> p>[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
[terminal] code>简写作为终端盒。It also shows prompt only on lines explitly set to do that.它还仅在明确设置的行上显示提示。 p>Basic Usage基本用法 h4>The most basic usage is to wrap your terminal blocks with [terminal][/terminal] tags.最基本的用法是用 [terminal] [/ terminal] code>标签包装接线盒。If no further options are defined within the tag a generic prompt is generated using ‘user@computer’ with no working directory shown.如果标记中未定义其他选项,则会使用“ user @ computer”生成通用提示,但不会显示工作目录。This is similar to exporting PS1=”\u@\h:$ ” in sh(1), setting prompt=”%n@%m:$ ” in csh(1), etc.这类似于在sh(1)中导出PS1 =” \ u @ \ h:$”,在csh(1)中设置提示符=“%n @%m:$”,等等。Other options available within the tag are user=”user”, computer=”computer”, and cwd=”/path/to/directory”.标签内可用的其他选项是user =“用户”,computer =“计算机”和cwd =“ / path / to / directory”。These allow you to override the generic user@computer settings as well as provide a ‘current working directory’.这些使您可以覆盖常规的user @ computer设置,并提供“当前工作目录”。The prompt is only shown on the lines starting with ‘$ ‘.提示仅显示在以“ $”开头的行上。So you can mix commands with simulated terminal output.因此,您可以将命令与模拟终端输出混合使用。 p>Usage用法 h3>Wrap terminal blocks with [terminal user="username" computer="computername" cwd="/path/to/directory"] and [\terminal].用 [终端用户=“用户名” computer =“计算机名” cwd =“ /路径/目标目录”] code>和 [\ terminal] code>包裹接线盒。They are all optional.它们都是可选的。“user” and “computer” will be shown if you don’t provide them, cwd is purely optional.如果您不提供“用户”和“计算机”,则会显示出来,cwd完全是可选的。 p>Example 1: No customized command 示例1:无自定义命令 strong> p>[terminal] [终端]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 2: User and computer customizations 示例2:用户和计算机自定义 strong> p>[terminal user="tux" computer="linux"] [终端用户=“ tux” computer =“ linux”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 3: Customizing just the user 示例3:仅自定义用户 strong> p>[terminal user="dak"] [终端用户=“ dak”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 4: Customizing user, computer and displaying a working directory 示例4:自定义用户,计算机并显示工作目录 strong> p>[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
It also shows prompt only on lines explitly set to do that.
它还仅在明确设置的行上显示提示。 p>
The most basic usage is to wrap your terminal blocks with [terminal][/terminal] tags.
[terminal][/terminal]
最基本的用法是用 [terminal] [/ terminal] code>标签包装接线盒。If no further options are defined within the tag a generic prompt is generated using ‘user@computer’ with no working directory shown.如果标记中未定义其他选项,则会使用“ user @ computer”生成通用提示,但不会显示工作目录。This is similar to exporting PS1=”\u@\h:$ ” in sh(1), setting prompt=”%n@%m:$ ” in csh(1), etc.这类似于在sh(1)中导出PS1 =” \ u @ \ h:$”,在csh(1)中设置提示符=“%n @%m:$”,等等。Other options available within the tag are user=”user”, computer=”computer”, and cwd=”/path/to/directory”.标签内可用的其他选项是user =“用户”,computer =“计算机”和cwd =“ / path / to / directory”。These allow you to override the generic user@computer settings as well as provide a ‘current working directory’.这些使您可以覆盖常规的user @ computer设置,并提供“当前工作目录”。The prompt is only shown on the lines starting with ‘$ ‘.提示仅显示在以“ $”开头的行上。So you can mix commands with simulated terminal output.因此,您可以将命令与模拟终端输出混合使用。 p>Usage用法 h3>Wrap terminal blocks with [terminal user="username" computer="computername" cwd="/path/to/directory"] and [\terminal].用 [终端用户=“用户名” computer =“计算机名” cwd =“ /路径/目标目录”] code>和 [\ terminal] code>包裹接线盒。They are all optional.它们都是可选的。“user” and “computer” will be shown if you don’t provide them, cwd is purely optional.如果您不提供“用户”和“计算机”,则会显示出来,cwd完全是可选的。 p>Example 1: No customized command 示例1:无自定义命令 strong> p>[terminal] [终端]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 2: User and computer customizations 示例2:用户和计算机自定义 strong> p>[terminal user="tux" computer="linux"] [终端用户=“ tux” computer =“ linux”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 3: Customizing just the user 示例3:仅自定义用户 strong> p>[terminal user="dak"] [终端用户=“ dak”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 4: Customizing user, computer and displaying a working directory 示例4:自定义用户,计算机并显示工作目录 strong> p>[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
[terminal] [/ terminal] code>标签包装接线盒。If no further options are defined within the tag a generic prompt is generated using ‘user@computer’ with no working directory shown.如果标记中未定义其他选项,则会使用“ user @ computer”生成通用提示,但不会显示工作目录。This is similar to exporting PS1=”\u@\h:$ ” in sh(1), setting prompt=”%n@%m:$ ” in csh(1), etc.这类似于在sh(1)中导出PS1 =” \ u @ \ h:$”,在csh(1)中设置提示符=“%n @%m:$”,等等。Other options available within the tag are user=”user”, computer=”computer”, and cwd=”/path/to/directory”.标签内可用的其他选项是user =“用户”,computer =“计算机”和cwd =“ / path / to / directory”。These allow you to override the generic user@computer settings as well as provide a ‘current working directory’.这些使您可以覆盖常规的user @ computer设置,并提供“当前工作目录”。The prompt is only shown on the lines starting with ‘$ ‘.提示仅显示在以“ $”开头的行上。So you can mix commands with simulated terminal output.因此,您可以将命令与模拟终端输出混合使用。 p>Usage用法 h3>Wrap terminal blocks with [terminal user="username" computer="computername" cwd="/path/to/directory"] and [\terminal].用 [终端用户=“用户名” computer =“计算机名” cwd =“ /路径/目标目录”] code>和 [\ terminal] code>包裹接线盒。They are all optional.它们都是可选的。“user” and “computer” will be shown if you don’t provide them, cwd is purely optional.如果您不提供“用户”和“计算机”,则会显示出来,cwd完全是可选的。 p>Example 1: No customized command 示例1:无自定义命令 strong> p>[terminal] [终端]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 2: User and computer customizations 示例2:用户和计算机自定义 strong> p>[terminal user="tux" computer="linux"] [终端用户=“ tux” computer =“ linux”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 3: Customizing just the user 示例3:仅自定义用户 strong> p>[terminal user="dak"] [终端用户=“ dak”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 4: Customizing user, computer and displaying a working directory 示例4:自定义用户,计算机并显示工作目录 strong> p>[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
If no further options are defined within the tag a generic prompt is generated using ‘user@computer’ with no working directory shown.
如果标记中未定义其他选项,则会使用“ user @ computer”生成通用提示,但不会显示工作目录。
This is similar to exporting PS1=”\u@\h:$ ” in sh(1), setting prompt=”%n@%m:$ ” in csh(1), etc.
这类似于在sh(1)中导出PS1 =” \ u @ \ h:$”,在csh(1)中设置提示符=“%n @%m:$”,等等。
Other options available within the tag are user=”user”, computer=”computer”, and cwd=”/path/to/directory”.
标签内可用的其他选项是user =“用户”,computer =“计算机”和cwd =“ / path / to / directory”。
These allow you to override the generic user@computer settings as well as provide a ‘current working directory’.
这些使您可以覆盖常规的user @ computer设置,并提供“当前工作目录”。
The prompt is only shown on the lines starting with ‘$ ‘.
提示仅显示在以“ $”开头的行上。
So you can mix commands with simulated terminal output.
因此,您可以将命令与模拟终端输出混合使用。 p>
Wrap terminal blocks with [terminal user="username" computer="computername" cwd="/path/to/directory"] and [\terminal].
[terminal user="username" computer="computername" cwd="/path/to/directory"]
[\terminal]
用 [终端用户=“用户名” computer =“计算机名” cwd =“ /路径/目标目录”] code>和 [\ terminal] code>包裹接线盒。They are all optional.它们都是可选的。“user” and “computer” will be shown if you don’t provide them, cwd is purely optional.如果您不提供“用户”和“计算机”,则会显示出来,cwd完全是可选的。 p>Example 1: No customized command 示例1:无自定义命令 strong> p>[terminal] [终端]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 2: User and computer customizations 示例2:用户和计算机自定义 strong> p>[terminal user="tux" computer="linux"] [终端用户=“ tux” computer =“ linux”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 3: Customizing just the user 示例3:仅自定义用户 strong> p>[terminal user="dak"] [终端用户=“ dak”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 4: Customizing user, computer and displaying a working directory 示例4:自定义用户,计算机并显示工作目录 strong> p>[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
[终端用户=“用户名” computer =“计算机名” cwd =“ /路径/目标目录”] code>和 [\ terminal] code>包裹接线盒。They are all optional.它们都是可选的。“user” and “computer” will be shown if you don’t provide them, cwd is purely optional.如果您不提供“用户”和“计算机”,则会显示出来,cwd完全是可选的。 p>Example 1: No customized command 示例1:无自定义命令 strong> p>[terminal] [终端]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 2: User and computer customizations 示例2:用户和计算机自定义 strong> p>[terminal user="tux" computer="linux"] [终端用户=“ tux” computer =“ linux”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 3: Customizing just the user 示例3:仅自定义用户 strong> p>[terminal user="dak"] [终端用户=“ dak”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 4: Customizing user, computer and displaying a working directory 示例4:自定义用户,计算机并显示工作目录 strong> p>[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
[\ terminal] code>包裹接线盒。They are all optional.它们都是可选的。“user” and “computer” will be shown if you don’t provide them, cwd is purely optional.如果您不提供“用户”和“计算机”,则会显示出来,cwd完全是可选的。 p>Example 1: No customized command 示例1:无自定义命令 strong> p>[terminal] [终端]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 2: User and computer customizations 示例2:用户和计算机自定义 strong> p>[terminal user="tux" computer="linux"] [终端用户=“ tux” computer =“ linux”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 3: Customizing just the user 示例3:仅自定义用户 strong> p>[terminal user="dak"] [终端用户=“ dak”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 4: Customizing user, computer and displaying a working directory 示例4:自定义用户,计算机并显示工作目录 strong> p>[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
They are all optional.
它们都是可选的。
“user” and “computer” will be shown if you don’t provide them, cwd is purely optional.
如果您不提供“用户”和“计算机”,则会显示出来,cwd完全是可选的。 p>
Example 1: No customized command
示例1:无自定义命令 strong> p>[terminal] [终端]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 2: User and computer customizations 示例2:用户和计算机自定义 strong> p>[terminal user="tux" computer="linux"] [终端用户=“ tux” computer =“ linux”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 3: Customizing just the user 示例3:仅自定义用户 strong> p>[terminal user="dak"] [终端用户=“ dak”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 4: Customizing user, computer and displaying a working directory 示例4:自定义用户,计算机并显示工作目录 strong> p>[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
[terminal] [终端]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 2: User and computer customizations 示例2:用户和计算机自定义 strong> p>[terminal user="tux" computer="linux"] [终端用户=“ tux” computer =“ linux”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 3: Customizing just the user 示例3:仅自定义用户 strong> p>[terminal user="dak"] [终端用户=“ dak”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 4: Customizing user, computer and displaying a working directory 示例4:自定义用户,计算机并显示工作目录 strong> p>[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
[终端]$ ls -a$ ls -a[/terminal][/终奌站]
$ ls -a
[/terminal]
[/终奌站]
code> pre>
Example 2: User and computer customizations
示例2:用户和计算机自定义 strong> p>[terminal user="tux" computer="linux"] [终端用户=“ tux” computer =“ linux”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 3: Customizing just the user 示例3:仅自定义用户 strong> p>[terminal user="dak"] [终端用户=“ dak”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 4: Customizing user, computer and displaying a working directory 示例4:自定义用户,计算机并显示工作目录 strong> p>[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
[terminal user="tux" computer="linux"] [终端用户=“ tux” computer =“ linux”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 3: Customizing just the user 示例3:仅自定义用户 strong> p>[terminal user="dak"] [终端用户=“ dak”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 4: Customizing user, computer and displaying a working directory 示例4:自定义用户,计算机并显示工作目录 strong> p>[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
[终端用户=“ tux” computer =“ linux”]$ ls -a$ ls -a[/terminal][/终奌站]
Example 3: Customizing just the user
示例3:仅自定义用户 strong> p>[terminal user="dak"] [终端用户=“ dak”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 4: Customizing user, computer and displaying a working directory 示例4:自定义用户,计算机并显示工作目录 strong> p>[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
[terminal user="dak"] [终端用户=“ dak”]$ ls -a$ ls -a[/terminal][/终奌站] code> pre>Example 4: Customizing user, computer and displaying a working directory 示例4:自定义用户,计算机并显示工作目录 strong> p>[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
[终端用户=“ dak”]$ ls -a$ ls -a[/terminal][/终奌站]
Example 4: Customizing user, computer and displaying a working directory
示例4:自定义用户,计算机并显示工作目录 strong> p>[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
[terminal user="root" computer="linuxserver" cwd="/usr/src/linux"] [终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站] code> pre>
[终端用户=“ root” computer =“ linuxserver” cwd =“ / usr / src / linux”]$ make mrproper $使mrproper ... ... ......[/terminal][/终奌站]
$ make mrproper
$使mrproper
...
ol>
原文出处:http://www.sanshu.cn/a/4938.html
群主管理都是支付大佬