更新 README.md

This commit is contained in:
2024-07-25 16:17:37 +08:00
parent 37da4c9700
commit a738442fb0

View File

@@ -458,11 +458,11 @@ echo $(expr index "$str" H) # 结果为 6
### 7.4 子串截除
![](./img/子串截除.png)
<img src="./img/子串截除.png" width="800" height="600">
### 7.5 子串替换
![](./img/子串替换.png)
<img src="./img/子串替换.png" width="800" height="600">
### 7.6 子串高级用法
@@ -903,7 +903,7 @@ echo -e "\033[47m This is White background \033[1m"
```
打印信息如下:
![](./img/shell字体显示颜色.png)
<img src="./img/shell字体显示颜色.png" width="500" height="408">
更多详细情况请移步 https://misc.flogisoft.com/bash/tip_colors_and_formatting
@@ -1125,18 +1125,18 @@ grep [OPTION]... PATTERN [FILE]... # pattern 可以是要搜索的字符串
### 15.1 常用查找option说明
|option|全称|说明|示例|
|:--:|:--:|:--|:--|
|`-i`|`--ignore-case`|在搜索时`忽略大小写`|![](./img/grep忽略大小写.png)|
|`-w`|`--word-regexp`|强制匹配整个字符单词|![](./img/grep强制匹配完整字符.png)|
|`-i`|`--ignore-case`|在搜索时`忽略大小写`|<img src="./img/grep忽略大小写.png" width="500" height="183">|
|`-w`|`--word-regexp`|强制匹配整个字符单词|<img src="./img/grep强制匹配完整字符.png" width="500" height="63">|
### 15.2 输出控制option说明
|option|全称|说明|示例|
|:--:|:--:|:--|:--|
|`-c`|`--count`|显示pattern匹配的次数|![](./img/grep输出控制计数.png)|
|`-l`|`--files-with-matches`|显示文件中匹配字符的文件名|![](./img/grep显示存在字符的文件名.png)|
|`-n`|`--line-number`|打印字符匹配所在的行|![](./img/grep打印pattern所在的行.png)|
|`-o`|`--only-matching`|仅显示匹配的字符串(可以和 `-n` 结合使用)|![](./img/grep仅显示匹配的字符.png)|
|`-v`|`--invert-match`|小写,显示不匹配字符的内容|![](./img/grep显示匹配patten的字符内容.png)|
|`-m`|`--max-count=NUM`|显示匹配字符的某一行的内容,适合绝对匹配|![](./img/grep显示匹配pattern的特定内容.png)|
|`-c`|`--count`|显示pattern匹配的次数|<img src="./img/grep输出控制计数.png" width="500" height="153">|
|`-l`|`--files-with-matches`|显示文件中匹配字符的文件名|<img src="./img/grep显示存在字符的文件名.png" width="500" height="107">|
|`-n`|`--line-number`|打印字符匹配所在的行|<img src="./img/grep打印pattern所在的行.png" width="500" height="166">|
|`-o`|`--only-matching`|仅显示匹配的字符串(可以和 `-n` 结合使用)|<img src="./img/grep仅显示匹配的字符.png" width="500" height="183">|
|`-v`|`--invert-match`|小写,显示不匹配字符的内容|<img src="./img/grep显示匹配的字符.png" width="500" height="175">|
|`-m`|`--max-count=NUM`|显示匹配字符的某一行的内容,适合绝对匹配|<img src="./img/grep显示匹配的字符.png" width="500" height="172">|
### 15.3 其他两个常用RE进行的grep操作
@@ -1147,7 +1147,7 @@ grep [OPTION]... PATTERN [FILE]... # pattern 可以是要搜索的字符串
```
示例:
![](./img/grep显示以pattern开头的内容.png)
<img src="./img/grep显示以pattern开头的内容.png" width="500" height="195">
- 显示以 “xxxx” 结尾的文件名或者文件内容行,使用符号 `$`
@@ -1156,8 +1156,7 @@ grep [OPTION]... PATTERN [FILE]... # pattern 可以是要搜索的字符串
```
示例:
![](./img/grep显示以pattern结尾的内容行.png)
<img src="./img/grep显示以pattern结尾的内容行.png" width="500" height="166">
## 16. Linux三剑客 --- sed
sed ----- stream editor是文本处理工具。主要是查找并替换文本字符串等。
@@ -1246,7 +1245,7 @@ shellcheck testop.sh
```
显示信息:
![](./img/shellcheck例子.png)
<img src="./img/shellcheck例子.png" width="500" height="344">
## 19. shell 表达式