Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
5b71225628 | |||
42f81f6d4c | |||
e21ec025f1 | |||
e7f3a27a12 | |||
8980702cba | |||
4cfd666deb | |||
9d89966d1a | |||
f2fa503dda | |||
dc77e2bf7f | |||
386bea869f | |||
449248c6e0 | |||
38a704244c | |||
6552a80582 | |||
492ef01fce | |||
e33da068d8 | |||
a26654abab | |||
627c6fe883 | |||
bcaeb1828a | |||
d8a05dfbd5 | |||
6810d618c5 | |||
33ed20a7ea | |||
8a6042bffc | |||
88c09562a2 | |||
440e56da2c | |||
202d20e15b | |||
2cd9b59c98 | |||
7cfda1e9b8 | |||
60af572979 | |||
50b597feee | |||
be7e853d41 | |||
7226d3604b |
2
.gitattributes
vendored
@ -1 +1,3 @@
|
||||
Dockerfile linguist-documentation=false
|
||||
.husky/* linguist-vendored
|
||||
*.md linguist-detectable=true
|
16
.refsrc.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"description": "{{description}},为开发人员分享快速参考备忘单。",
|
||||
"keywords": "reference,Quick,Reference,cheatsheet,cheat,sheet",
|
||||
"data-info": "👆待完善需要您的参与",
|
||||
"search": {
|
||||
"label": "搜索",
|
||||
"placeholder": "搜索备忘清单",
|
||||
"cancel": "取消"
|
||||
},
|
||||
"editor": {
|
||||
"label": "编辑"
|
||||
},
|
||||
"github": {
|
||||
"url": "https://github.com/jaywcjlove/reference"
|
||||
}
|
||||
}
|
@ -157,12 +157,12 @@ REF_LABEL=网站首页
|
||||
<a href="https://github.com/Alex-Programer" title="Alex">
|
||||
<img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/>
|
||||
</a>
|
||||
<a href="https://github.com/expoli" title="expoli">
|
||||
<img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli"/>
|
||||
</a>
|
||||
<a href="https://github.com/JeffersonHuang" title="Jefferson">
|
||||
<img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson"/>
|
||||
</a>
|
||||
<a href="https://github.com/expoli" title="expoli">
|
||||
<img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli"/>
|
||||
</a>
|
||||
<a href="https://github.com/sjh42" title="42:p">
|
||||
<img src="https://avatars.githubusercontent.com/u/34529275?v=4" width="42;" alt="42:p"/>
|
||||
</a>
|
||||
|
13
README.md
@ -25,6 +25,7 @@ Quick Reference
|
||||
[Django](./docs/djiango.md)<!--rehype:style=background: rgb(12 75 51);&class=contributing tag&data-lang=Python-->
|
||||
[FFmpeg](./docs/ffmpeg.md)<!--rehype:style=background: rgb(0 193 9);&class=contributing-->
|
||||
[Flutter](./docs/flutter.md)<!--rehype:style=background: rgb(150 220 254);&class=contributing tag&data-lang=Dart-->
|
||||
[Gitlab CI/CD](./docs/gitlab-ci.md)<!--rehype:style=background: rgb(226 67 41);&class=contributing-->
|
||||
[LaTeX](./docs/latex.md)<!--rehype:style=background: rgb(0 128 128);&class=contributing-->
|
||||
[Lua](./docs/lua.md)<!--rehype:style=background: rgb(3 3 128);-->
|
||||
[NestJS](./docs/nestjs.md)<!--rehype:style=background: rgb(237 21 67);&class=contributing-->
|
||||
@ -156,6 +157,7 @@ Quick Reference
|
||||
|
||||
[Quick Reference](./docs/quickreference.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=排版说明-->
|
||||
[Github Actions](./docs/github-actions.md)<!--rehype:style=background: rgb(121 184 255);-->
|
||||
[Gitlab CI/CD](./docs/gitlab-ci.md)<!--rehype:style=background: rgb(226 67 41);&class=contributing-->
|
||||
[Colors Named](./docs/colors-named.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=CSS-->
|
||||
[HTTP 状态码](./docs/http-status-code.md)<!--rehype:style=background: rgb(16 185 129);-->
|
||||
[HTML 字符实体](./docs/html-char.md)<!--rehype:style=background: rgb(16 185 129);&class=tag&data-lang=HTML-->
|
||||
@ -192,12 +194,12 @@ Quick Reference
|
||||
<a href="https://github.com/Alex-Programer" title="Alex">
|
||||
<img src="https://avatars.githubusercontent.com/u/115539090?v=4" width="42;" alt="Alex"/>
|
||||
</a>
|
||||
<a href="https://github.com/expoli" title="expoli">
|
||||
<img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli"/>
|
||||
</a>
|
||||
<a href="https://github.com/JeffersonHuang" title="Jefferson">
|
||||
<img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson"/>
|
||||
</a>
|
||||
<a href="https://github.com/expoli" title="expoli">
|
||||
<img src="https://avatars.githubusercontent.com/u/31023767?v=4" width="42;" alt="expoli"/>
|
||||
</a>
|
||||
<a href="https://github.com/sjh42" title="42:p">
|
||||
<img src="https://avatars.githubusercontent.com/u/34529275?v=4" width="42;" alt="42:p"/>
|
||||
</a>
|
||||
@ -321,13 +323,14 @@ Quick Reference
|
||||
|
||||
由于中国国内访问,时常打不开,你可以访问下面镜像网站。推荐自己的[镜像网站](https://github.com/jaywcjlove/reference/issues/102#issue-1451649637)
|
||||
|
||||
[quickref.cn](https://quickref.cn)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[ecdata.cn](http://ref.ecdata.cn)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[mofe.io](http://quickref.mofe.io)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[aibk.cn](https://quickref.aibk.cn)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[jgeek.cn](http://reference.jgeek.cn/)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[laoleng.vip](http://bbs.laoleng.vip/reference/)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[liujiapeng.com](https://www.liujiapeng.com/)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[dbyun.net](https://www.dbyun.net/reference/index.html)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
[cyolc932.fun](https://cyolc932.fun/reference/)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;&class=contributing tag&data-info=👆需要梯子-->
|
||||
[dc6.fun](https://dc6.fun/reference/)<!--rehype:target=_blank&style=background: rgb(16 185 129);height: 2.6rem;border-radius: 2rem;font-weight: bold;-->
|
||||
<!--rehype:class=home-card&style=margin:2.2rem 0;display: flex;justify-content: center;gap: 1rem;flex-wrap: wrap;-->
|
||||
|
||||
如果你有资源,可以很方便部署 web 版,这非常简单,只需要克隆 gh-pages 分支代码到你的静态服务就可以了,还可以使用 [docker](https://hub.docker.com/r/wcjiang/reference) 快捷部署 web 版。
|
||||
|
Before Width: | Height: | Size: 648 B After Width: | Height: | Size: 648 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 640 B After Width: | Height: | Size: 640 B |
Before Width: | Height: | Size: 274 B After Width: | Height: | Size: 274 B |
Before Width: | Height: | Size: 892 B After Width: | Height: | Size: 892 B |
Before Width: | Height: | Size: 473 B After Width: | Height: | Size: 473 B |
Before Width: | Height: | Size: 514 B After Width: | Height: | Size: 514 B |
Before Width: | Height: | Size: 674 B After Width: | Height: | Size: 674 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 302 B After Width: | Height: | Size: 302 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 325 B After Width: | Height: | Size: 325 B |
Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 526 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 713 B After Width: | Height: | Size: 713 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 824 B After Width: | Height: | Size: 824 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 436 B After Width: | Height: | Size: 436 B |
Before Width: | Height: | Size: 950 B After Width: | Height: | Size: 950 B |
Before Width: | Height: | Size: 717 B After Width: | Height: | Size: 717 B |
Before Width: | Height: | Size: 498 B After Width: | Height: | Size: 498 B |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
9
assets/gitlab-ci.svg
Normal file
@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 236" height="1em" width="1em">
|
||||
<path d="m128.075 236.075 47.104-144.97H80.97l47.104 144.97z" fill="#E24329"/>
|
||||
<path d="M128.075 236.074 80.97 91.104H14.956l113.119 144.97z" fill="#FC6D26"/>
|
||||
<path d="M14.956 91.104.642 135.16a9.752 9.752 0 0 0 3.542 10.903l123.891 90.012-113.12-144.97z" fill="#FCA326"/>
|
||||
<path d="M14.956 91.105H80.97L52.601 3.79c-1.46-4.493-7.816-4.492-9.275 0l-28.37 87.315z" fill="#E24329"/>
|
||||
<path d="m128.075 236.074 47.104-144.97h66.015l-113.12 144.97z" fill="#FC6D26"/>
|
||||
<path d="m241.194 91.104 14.314 44.056a9.752 9.752 0 0 1-3.543 10.903l-123.89 90.012 113.119-144.97z" fill="#FCA326"/>
|
||||
<path d="M241.194 91.105h-66.015l28.37-87.315c1.46-4.493 7.816-4.492 9.275 0l28.37 87.315z" fill="#E24329"/>
|
||||
</svg>
|
After Width: | Height: | Size: 798 B |
Before Width: | Height: | Size: 358 B After Width: | Height: | Size: 358 B |
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 601 B After Width: | Height: | Size: 601 B |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 319 B After Width: | Height: | Size: 319 B |
Before Width: | Height: | Size: 940 B After Width: | Height: | Size: 940 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 937 B After Width: | Height: | Size: 937 B |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 224 KiB After Width: | Height: | Size: 224 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 451 B After Width: | Height: | Size: 451 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 416 B After Width: | Height: | Size: 416 B |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 338 B |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 429 B After Width: | Height: | Size: 429 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 894 B After Width: | Height: | Size: 894 B |
Before Width: | Height: | Size: 479 B After Width: | Height: | Size: 479 B |
Before Width: | Height: | Size: 862 B After Width: | Height: | Size: 862 B |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 557 B After Width: | Height: | Size: 557 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 733 B After Width: | Height: | Size: 733 B |
Before Width: | Height: | Size: 706 B After Width: | Height: | Size: 706 B |
Before Width: | Height: | Size: 460 B After Width: | Height: | Size: 460 B |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 532 B After Width: | Height: | Size: 532 B |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 412 B After Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 262 B After Width: | Height: | Size: 262 B |
Before Width: | Height: | Size: 360 B After Width: | Height: | Size: 360 B |
Before Width: | Height: | Size: 749 B After Width: | Height: | Size: 749 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 432 B After Width: | Height: | Size: 432 B |
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 269 B After Width: | Height: | Size: 269 B |
Before Width: | Height: | Size: 828 B After Width: | Height: | Size: 828 B |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 449 B After Width: | Height: | Size: 449 B |
Before Width: | Height: | Size: 835 B After Width: | Height: | Size: 835 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
144
docs/bash.md
@ -366,7 +366,7 @@ Bash 条件句
|
||||
`[[ -z STR ]]` | 空字符串
|
||||
`[[ -n STR ]]` | <yel>非</yel>空字符串
|
||||
`[[ STR == STR ]]` | 相等
|
||||
`[[ STR = STR ]]` | 相等(同上)
|
||||
`[[ STR = STR ]]` | 相等(同上)
|
||||
`[[ STR < STR ]]` | 小于 _(ASCII)_
|
||||
`[[ STR > STR ]]` | 大于 _(ASCII)_
|
||||
`[[ STR != STR ]]` | 不相等
|
||||
@ -562,7 +562,7 @@ while true; do
|
||||
done
|
||||
```
|
||||
|
||||
### 死循环(简写)
|
||||
### 死循环(简写)
|
||||
|
||||
```bash
|
||||
while :; do
|
||||
@ -590,7 +590,7 @@ myfunc() {
|
||||
```
|
||||
|
||||
```bash
|
||||
# 同上(替代语法)
|
||||
# 同上(替代语法)
|
||||
function myfunc() {
|
||||
echo "hello $1"
|
||||
}
|
||||
@ -711,7 +711,7 @@ Bash 历史
|
||||
|
||||
代码 | 描述
|
||||
:- | -
|
||||
`!!:n` | 仅扩展最近命令中的第 `n` 个标记(命令为 `0`;第一个参数为 `1`)
|
||||
`!!:n` | 仅扩展最近命令中的第 `n` 个标记(命令为 `0`;第一个参数为 `1`)
|
||||
`!^` | 从最近的命令展开第一个参数
|
||||
`!$` | 从最近的命令中展开最后一个标记
|
||||
`!!:n-m` | 从最近的命令扩展令牌范围
|
||||
@ -750,12 +750,12 @@ command -V cd
|
||||
<!--rehype:wrap-class=row-span-2 col-span-2-->
|
||||
|
||||
```bash
|
||||
python hello.py > output.txt # 标准输出到(文件)
|
||||
python hello.py >> output.txt # 标准输出到(文件),追加
|
||||
python hello.py 2> error.log # 标准错误到(文件)
|
||||
python hello.py > output.txt # 标准输出到(文件)
|
||||
python hello.py >> output.txt # 标准输出到(文件),追加
|
||||
python hello.py 2> error.log # 标准错误到(文件)
|
||||
python hello.py 2>&1 # 标准错误到标准输出
|
||||
python hello.py 2>/dev/null # 标准错误到(空null)
|
||||
python hello.py &>/dev/null # 标准输出和标准错误到(空null)
|
||||
python hello.py 2>/dev/null # 标准错误到(空null)
|
||||
python hello.py &>/dev/null # 标准输出和标准错误到(空null)
|
||||
```
|
||||
|
||||
```bash
|
||||
@ -953,6 +953,131 @@ echo "${args[@]}"
|
||||
|
||||
将参数放入数组中,然后追加
|
||||
|
||||
Bash 颜色
|
||||
----
|
||||
|
||||
### 颜色着色语法示例
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
您可以通过为其输出着色来使您的 BASH 脚本更漂亮,使用以下模板编写彩色文本:
|
||||
|
||||
```bash
|
||||
echo -e "\e[COLORm文字变色了\e[0m"
|
||||
```
|
||||
|
||||
#### 示例
|
||||
|
||||
```bash
|
||||
$ echo -e "\e[31m命令行中显示红色文字\e[0m"
|
||||
```
|
||||
|
||||
<red>命令行中显示红色文字</red>
|
||||
|
||||
```
|
||||
$ echo -e "\e[42m绿色背景\e[0m"
|
||||
```
|
||||
|
||||
`绿色背景`<!--rehype:style=background:green;color: black;-->
|
||||
|
||||
Option | Description
|
||||
:- | --
|
||||
`-e` | 启用反斜杠转义的解释
|
||||
`\e[` 或 `\x1b[` 或 `\033[` | 开始颜色修改
|
||||
`COLORm` | 颜色代码 + `m` 在末尾
|
||||
`\e[0m` 或 `\x1b[0m` 或 `\033[0m` | 结束颜色修改
|
||||
<!--rehype:className=left-align-->
|
||||
|
||||
`0x1b` 字面上称为 `ESC`
|
||||
|
||||
#### 示例
|
||||
|
||||
```bash
|
||||
$ echo -e "\e[3m下划线文本\e[0m"
|
||||
```
|
||||
|
||||
`下划线文本`<!--rehype:style=text-decoration: underline;color: inherit;-->
|
||||
|
||||
```bash
|
||||
$ echo -e "\e[1;33;4;44m粗体下划线蓝色背景黄色文字的文本\e[0m"
|
||||
```
|
||||
<!--rehype:className=wrap-text-->
|
||||
|
||||
`粗体下划线蓝色背景黄色文字的文本`<!--rehype:style=text-decoration: underline;color: inherit;font-weight: bold;color: #cdcd00;background: #0000ee;-->
|
||||
|
||||
```bash
|
||||
\e[ # 启用转义
|
||||
1;33;4;44 # 参数 (1;33;4;44)
|
||||
m # 设置图形模式
|
||||
```
|
||||
|
||||
#### 样式
|
||||
|
||||
:- | -- | --
|
||||
:- | -- | --
|
||||
`0` | 普通字符(复位或正常) | 关闭所有属性
|
||||
`1` | **粗体**字
|
||||
`2` | 弱化(降低强度) | 未广泛支持
|
||||
`3` | 斜体 | 未广泛支持有时为反相显示
|
||||
`4` | 下划线
|
||||
`5` | 缓慢闪烁
|
||||
`6` | 快速闪烁
|
||||
`7` | 反显
|
||||
`8` | 隐藏 | 未广泛支持。
|
||||
`9` | 划除
|
||||
<!--rehype:className=left-align-->
|
||||
### ANSI — 颜色转义码
|
||||
|
||||
颜色 | 前景色 | 背景色 | 示例
|
||||
:- | -- | -- | --
|
||||
`Black` 黑色 | 30 | 40 | ``<!--rehype:style=background:#000;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Red` 红色 | 31 | 41 | ``<!--rehype:style=background:#c23621;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Green` 绿色 | 32 | 42 | ``<!--rehype:style=background:#25bc26;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Yellow` 黄色 | 33 | 43 | ``<!--rehype:style=background:#cdcd00;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Blue` 蓝色 | 34 | 44 | ``<!--rehype:style=background:#0000ee;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Purple` 紫色 | 35 | 45 | ``<!--rehype:style=background:#cd00cd;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Cyan` 青色 | 36 | 46 | ``<!--rehype:style=background:#00AAAA;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`White` 白色 | 37 | 47 | ``<!--rehype:style=background:#e5e5e5;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
<!--rehype:className=show-header left-align-->
|
||||
|
||||
### ANSI — 颜色转义码(亮色)
|
||||
|
||||
颜色 | 前景色 | 背景色 | 示例
|
||||
:- | -- | -- | --
|
||||
`Bright Black(Gray)` 灰色 | 90 | 100 | ``<!--rehype:style=background:#555555;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Red` 亮红色 | 91 | 101 | ``<!--rehype:style=background:#FF5555;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Green` 亮绿色 | 92 | 102 | ``<!--rehype:style=background:#55FF55;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Yellow` 亮黄色 | 93 | 103 | ``<!--rehype:style=background:#FFFF55;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Blue` 亮蓝色 | 94 | 104 | ``<!--rehype:style=background:#5555FF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Magenta` 亮紫色 | 95 | 105 | ``<!--rehype:style=background:#FF55FF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright Cyan` 亮青色 | 96 | 106 | ``<!--rehype:style=background:#55FFFF;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
`Bright White` 浅灰 | 97 | 107 | ``<!--rehype:style=background:#ffffff;padding:0.2rem 1.2rem;border: 1px solid #333;-->
|
||||
<!--rehype:className=show-header left-align-->
|
||||
|
||||
### 可用功能
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
:- | -- | --
|
||||
:- | -- | --
|
||||
`n` A | 光标上移 | 光标向指定的方向移动 `n`(默认1)格
|
||||
`n` B | 光标下移 | 光标向指定的方向移动 `n`(默认1)格
|
||||
`n` C | 光标前移 | 光标向指定的方向移动 `n`(默认1)格
|
||||
`n` D | 光标后移 | 光标向指定的方向移动 `n`(默认1)格
|
||||
`n` E | 光标移到下一行 | 光标移动到下面第 `n`(默认1)行的开头(非ANSI.SYS)
|
||||
`n` F | 光标移到上一行 | 光标移动到上面第 `n`(默认1)行的开头(非ANSI.SYS)
|
||||
`n` G | 光标水平绝对 | 光标移动到第 `n`(默认1)列(非ANSI.SYS)
|
||||
`n`;`m` H | 光标位置 | 光标移动到第 `n`行、第 `m` 列。值从1开始,且默认为1(左上角)
|
||||
`n` J | ED – 擦除显示 | 清除屏幕的部分区域
|
||||
`n` K | EL – 擦除行 | 清除行内的部分区域
|
||||
`n` S | SU – 向上滚动 | 整页向上滚动 `n`(默认1)行。新行添加到底部 (非ANSI.SYS)
|
||||
`n` T | SD – 向下滚动 | 整页向下滚动 `n`(默认1)行。新行添加到顶部 (非ANSI.SYS)
|
||||
`n`;`m`f | HVP – 水平垂直位置 | 同CUP
|
||||
`n` `m` | SGR – 选择图形再现 | 设置SGR参数,包括文字颜色
|
||||
`5i` | 打开辅助端口 | 启用辅助串行端口,通常用于本地串行打印机
|
||||
`4i` | 关闭辅助端口 | 禁用辅助串行端口,通常用于本地串行打印机
|
||||
`6n` | DSR – 设备状态报告 | 以 `ESC[n;mR` (就像在键盘上输入)向应用程序报告光标位置(CPR),其中 `n`是行, `m` 是列
|
||||
`s` | SCP – 保存光标位置 | 保存光标的当前位置
|
||||
`u` | RCP – 恢复光标位置 | 恢复保存的光标位置
|
||||
|
||||
另见
|
||||
----
|
||||
|
||||
@ -964,3 +1089,4 @@ echo "${args[@]}"
|
||||
- [Bash Guide](http://mywiki.wooledge.org/BashGuide) _(mywiki.wooledge.org)_
|
||||
- [ShellCheck](https://www.shellcheck.net/) _(shellcheck.net)_
|
||||
- [shell - Standard Shell](https://devmanual.gentoo.org/tools-reference/bash/index.html) _(devmanual.gentoo.org)_
|
||||
- [ANSI 转义序列](https://zh.wikipedia.org/wiki/ANSI转义序列) _(zh.wikipedia.org)_
|
||||
|