Skip to content

Commit 4c8b256

Browse files
committed
adjust shell script group and order
1 parent 868fa5d commit 4c8b256

File tree

2 files changed

+79
-71
lines changed

2 files changed

+79
-71
lines changed

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,27 @@ source <(curl -fsSL https://raw.githubusercontent.com/oldratlee/useful-scripts/m
2828

2929
### :shell: [`Shell`相关脚本](docs/shell.md)
3030

31-
包含`Shell`使用或命令加强的脚本。
31+
`Shell`使用加强:
3232

3333
1. [c](docs/shell.md#beer-c)
3434
原样命令行输出,并拷贝标准输出到系统剪贴板,省去`CTRL+C``CTRL+V`操作。
3535
1. [colines](docs/shell.md#beer-colines)
3636
彩色`cat`出文件行,方便人眼区分不同的行。
3737
1. [a2l](docs/shell.md#beer-a2l)
3838
按行彩色输出参数,方便人眼查看。
39+
1. [xpl and xpf](docs/shell.md#beer-xpl-and-xpf)
40+
在命令行中快速完成 在文件浏览器中 打开/选中 指定的文件或文件夹的操作。
41+
1. [tcp-connection-state-counter.sh](docs/shell.md#beer-tcp-connection-state-countersh)
42+
统计各个`TCP`连接状态的个数。用于方便排查系统连接负荷问题。
43+
44+
`Shell`开发/测试加强:
45+
3946
1. [echo-args.sh](docs/shell.md#beer-echo-argssh)
4047
输出脚本收到的参数,在控制台运行时,把参数值括起的括号显示成 **红色**,方便人眼查看。用于调试脚本参数输入。
4148
1. [console-text-color-themes.sh](docs/shell.md#beer-console-text-color-themessh)
42-
显示`Terminator`的全部文字彩色组合的效果及其打印方式。
43-
1. [tcp-connection-state-counter.sh](docs/shell.md#beer-tcp-connection-state-countersh)
44-
统计各个`TCP`连接状态的个数。用于方便排查系统连接负荷问题。
49+
显示`Terminator`的全部文字彩色组合的效果及其打印方式,用于开发`Shell`的彩色输出。
4550
1. [parseOpts.sh](docs/shell.md#beer-parseoptssh)
46-
提供命令行选项解析函数`parseOpts`,以加强支持选项的值有多个值(即数组)。
47-
1. [xpl and xpf](docs/shell.md#beer-xpl-and-xpf)
48-
用于在命令行中直接完成 在文件浏览器中 打开/选中 指定的文件或文件夹的操作。
51+
提供命令行选项解析函数`parseOpts`。用于加强支持选项的值有多个值(即数组)。
4952

5053
### :watch: [`VCS`相关脚本](docs/vcs.md)
5154

docs/shell.md

Lines changed: 69 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
:snail: `Shell`相关脚本
22
====================================
33

4-
包含`Shell`使用或命令加强的脚本。
4+
`Shell`使用加强
5+
====================================
56

67
:beer: [c](../c)
78
----------------------
@@ -94,6 +95,73 @@ test-cases/self-installer.sh
9495

9596
注:上面显示中,没有彩色,在控制台上运行可以看出彩色效果。
9697

98+
:beer: [xpl](../xpl) and [xpf](../xpf)
99+
----------------------
100+
101+
在命令行中快速完成 在文件浏览器中 打开/选中 指定的文件或文件夹的操作。
102+
103+
* `xpl`:在文件浏览器中打开指定的文件或文件夹。
104+
\# `xpl``explorer`的缩写。
105+
* `xpf`: 在文件浏览器中打开指定的文件或文件夹,并选中。
106+
\# `xpf``explorer and select file`的缩写。
107+
108+
### 用法
109+
110+
```bash
111+
xpl
112+
# 缺省打开当前目录
113+
xpl <文件或是目录>...
114+
# 打开多个文件或目录
115+
116+
xpf
117+
# 缺省打开当前目录
118+
xpf <文件或是目录>...
119+
# 打开多个文件或目录
120+
```
121+
122+
### 示例
123+
124+
```bash
125+
xpl /path/to/dir
126+
xpl /path/to/foo.txt
127+
xpl /path/to/dir1 /path/to/foo1.txt
128+
xpf /path/to/foo1.txt
129+
xpf /path/to/dir1 /path/to/foo1.txt
130+
```
131+
132+
### 贡献者
133+
134+
[Linhua Tan](https://github.com/toolchainX)修复Linux的选定Bug。
135+
136+
:beer: [tcp-connection-state-counter.sh](../tcp-connection-state-counter.sh)
137+
----------------------
138+
139+
统计各个`TCP`连接状态的个数。
140+
141+
`Nginx``Apache`的机器上需要查看,`TCP`连接的个数,以判定
142+
143+
- 连接数、负荷
144+
- 是否有攻击,查看`SYN_RECV`数(`SYN`攻击)
145+
- `TIME_WAIT`数,太多会导致`TCP: time wait bucket table overflow`
146+
147+
### 用法
148+
149+
```bash
150+
tcp-connection-state-counter.sh
151+
```
152+
153+
### 示例
154+
155+
```bash
156+
$ tcp-connection-state-counter.sh
157+
ESTABLISHED 290
158+
TIME_WAIT 212
159+
SYN_SENT 17
160+
```
161+
162+
`Shell`开发/测试加强
163+
====================================
164+
97165
:beer: [echo-args.sh](../echo-args.sh)
98166
----------------------
99167

@@ -150,32 +218,6 @@ colorEchoWithoutNewLine "4;33;40" "Hello world!" "Hello Hell!"
150218

151219
- [utensil](https://github.com/utensil)[在Bash下输出彩色的文本](http://utensil.github.io/tech/2007/09/10/colorful-bash.html),这是篇很有信息量很钻研的文章!
152220

153-
:beer: [tcp-connection-state-counter.sh](../tcp-connection-state-counter.sh)
154-
----------------------
155-
156-
统计各个`TCP`连接状态的个数。
157-
158-
`Nginx``Apache`的机器上需要查看,`TCP`连接的个数,以判定
159-
160-
- 连接数、负荷
161-
- 是否有攻击,查看`SYN_RECV`数(`SYN`攻击)
162-
- `TIME_WAIT`数,太多会导致`TCP: time wait bucket table overflow`
163-
164-
### 用法
165-
166-
```bash
167-
tcp-connection-state-counter.sh
168-
```
169-
170-
### 示例
171-
172-
```bash
173-
$ tcp-connection-state-counter.sh
174-
ESTABLISHED 290
175-
TIME_WAIT 212
176-
SYN_SENT 17
177-
```
178-
179221
:beer: [parseOpts.sh](../parseOpts.sh)
180222
----------------------
181223

@@ -275,40 +317,3 @@ parseOpts "a,a-long|b,b-long:|c,c-long+" -a -b bv -- --c-long c.sh -p pv -q qv a
275317

276318
[Khotyn Huang](https://github.com/khotyn)指出`bash` `3.0`下使用有问题,并提供`bash` `3.0`的测试机器。
277319

278-
:beer: [xpl](../xpl) and [xpf](../xpf)
279-
----------------------
280-
281-
用于在命令行中直接完成 在文件浏览器中 打开/选中 指定的文件或文件夹的操作。
282-
283-
* `xpl`:在文件浏览器中打开指定的文件或文件夹。
284-
\# `xpl``explorer`的缩写。
285-
* `xpf`: 在文件浏览器中打开指定的文件或文件夹,并选中。
286-
\# `xpf``explorer and select file`的缩写。
287-
288-
### 用法
289-
290-
```bash
291-
xpl
292-
# 缺省打开当前目录
293-
xpl <文件或是目录>...
294-
# 打开多个文件或目录
295-
296-
xpf
297-
# 缺省打开当前目录
298-
xpf <文件或是目录>...
299-
# 打开多个文件或目录
300-
```
301-
302-
### 示例
303-
304-
```bash
305-
xpl /path/to/dir
306-
xpl /path/to/foo.txt
307-
xpl /path/to/dir1 /path/to/foo1.txt
308-
xpf /path/to/foo1.txt
309-
xpf /path/to/dir1 /path/to/foo1.txt
310-
```
311-
312-
### 贡献者
313-
314-
[Linhua Tan](https://github.com/toolchainX)修复Linux的选定Bug。

0 commit comments

Comments
 (0)