|
1 | 1 | :snail: `Shell`相关脚本 |
2 | 2 | ==================================== |
3 | 3 |
|
4 | | -包含`Shell`使用或命令加强的脚本。 |
| 4 | +`Shell`使用加强 |
| 5 | +==================================== |
5 | 6 |
|
6 | 7 | :beer: [c](../c) |
7 | 8 | ---------------------- |
@@ -94,6 +95,73 @@ test-cases/self-installer.sh |
94 | 95 |
|
95 | 96 | 注:上面显示中,没有彩色,在控制台上运行可以看出彩色效果。 |
96 | 97 |
|
| 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 | + |
97 | 165 | :beer: [echo-args.sh](../echo-args.sh) |
98 | 166 | ---------------------- |
99 | 167 |
|
@@ -150,32 +218,6 @@ colorEchoWithoutNewLine "4;33;40" "Hello world!" "Hello Hell!" |
150 | 218 |
|
151 | 219 | - [utensil](https://github.com/utensil)的[在Bash下输出彩色的文本](http://utensil.github.io/tech/2007/09/10/colorful-bash.html),这是篇很有信息量很钻研的文章! |
152 | 220 |
|
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 | | - |
179 | 221 | :beer: [parseOpts.sh](../parseOpts.sh) |
180 | 222 | ---------------------- |
181 | 223 |
|
@@ -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 |
275 | 317 |
|
276 | 318 | [Khotyn Huang](https://github.com/khotyn)指出`bash` `3.0`下使用有问题,并提供`bash` `3.0`的测试机器。 |
277 | 319 |
|
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