mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-04-22 00:22:09 +02:00
grep, ps, unzip: add Chinese translation (#12007)
* grep, ps, unzip: add Chinese translation * add newline at the end * Update pages.zh/common/grep.md * Update pages.zh/common/ps.md * Update pages.zh/common/ps.md * Update pages.zh/common/ps.md * Update pages.zh/common/ps.md * Update pages.zh/common/ps.md * Update pages.zh/common/ps.md * Update pages.zh/common/ps.md --------- Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com> Co-authored-by: Jack Lin <blueskyson1401@gmail.com>
This commit is contained in:
parent
13aa0a3a56
commit
7426b41b08
3 changed files with 97 additions and 0 deletions
36
pages.zh/common/grep.md
Normal file
36
pages.zh/common/grep.md
Normal file
|
@ -0,0 +1,36 @@
|
|||
# grep
|
||||
|
||||
> 使用正则表达式查找文件中的模式。
|
||||
> 更多信息:<https://www.gnu.org/software/grep/manual/grep.html>.
|
||||
|
||||
- 在文件中查找模式:
|
||||
|
||||
`grep "{{模式字符串}}" {{路径/到/文件}}`
|
||||
|
||||
- 在文件中精确地查找字符串(禁用正则表达式):
|
||||
|
||||
`grep --fixed-strings "{{字符串}}" {{路径/到/文件}}`
|
||||
|
||||
- 在指定目录下的所有文件中递归地查找模式,显示匹配的行号并忽略二进制文件:
|
||||
|
||||
`grep --recursive --line-number --binary-files={{without-match}} "{{模式字符串}}" {{路径/到/目录}}`
|
||||
|
||||
- 使用大小写不敏感的扩展正则表达式(支持 `?`、`+`、`{}`、`()` 和 `|`):
|
||||
|
||||
`grep --extended-regexp --ignore-case "{{模式字符串}}" {{路径/到/文件}}`
|
||||
|
||||
- 在每个匹配前后、之前或之后打印 3 行上下文:
|
||||
|
||||
`grep --{{context|before-context|after-context}}={{3}} "{{模式字符串}}" {{路径/到/文件}}`
|
||||
|
||||
- 以带有颜色的方式,打印每个匹配的文件名和行号:
|
||||
|
||||
`grep --with-filename --line-number --color=always "{{模式字符串}}" {{路径/到/文件}}`
|
||||
|
||||
- 只打印文件中与模式匹配的行:
|
||||
|
||||
`grep --only-matching "{{模式字符串}}" {{路径/到/文件}}`
|
||||
|
||||
- 从 `stdin`(标准输入)中查找与模式不匹配的行:
|
||||
|
||||
`cat {{路径/到/文件}} | grep --invert-match "{{模式字符串}}"`
|
32
pages.zh/common/ps.md
Normal file
32
pages.zh/common/ps.md
Normal file
|
@ -0,0 +1,32 @@
|
|||
# ps
|
||||
|
||||
> 提供正在运行的进程的信息。
|
||||
> 更多信息: <https://manned.org/ps>.
|
||||
|
||||
- 列出所有正在运行的进程:
|
||||
|
||||
`ps aux`
|
||||
|
||||
- 列出所有正在运行的进程,包括完整的命令字符串:
|
||||
|
||||
`ps auxww`
|
||||
|
||||
- 查找与字符串匹配的进程:
|
||||
|
||||
`ps aux | grep {{字符串}}`
|
||||
|
||||
- 以 extra full 格式列出当前用户的所有进程:
|
||||
|
||||
`ps --user $(id -u) -F`
|
||||
|
||||
- 以树形方式列出当前用户的所有进程:
|
||||
|
||||
`ps --user $(id -u) f`
|
||||
|
||||
- 获取一个进程的父进程 ID:
|
||||
|
||||
`ps -o ppid= -p {{进程 ID}}`
|
||||
|
||||
- 按内存使用量对进程进行排序:
|
||||
|
||||
`ps --sort size`
|
29
pages.zh/common/unzip.md
Normal file
29
pages.zh/common/unzip.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
# unzip
|
||||
|
||||
> 从 ZIP 压缩包中提取文件或目录。
|
||||
> 参见:`zip`.
|
||||
> 更多信息:<https://manned.org/unzip>.
|
||||
|
||||
- 将指定压缩包中的所有文件和目录提取到当前目录下:
|
||||
|
||||
`unzip {{路径/到/压缩文件1.zip 路径/到/压缩文件2.zip ...}}`
|
||||
|
||||
- 将压缩包中的所有文件和目录提取到指定目录下:
|
||||
|
||||
`unzip {{路径/到/压缩文件1.zip 路径/到/压缩文件2.zip ...}} -d {{路径/到/输出目录}}`
|
||||
|
||||
- 将压缩包中的文件和目录提取到 `stdout`(标准输出)中:
|
||||
|
||||
`unzip -c {{路径/到/压缩文件1.zip 路径/到/压缩文件2.zip ...}}`
|
||||
|
||||
- 提取文件内容及文件名到 `stdout`(标准输出)中:
|
||||
|
||||
`unzip -O {{gbk}} {{路径/到/压缩文件1.zip 路径/到/压缩文件2.zip ...}}`
|
||||
|
||||
- 在不进行解压缩的情况下,列出指定压缩包中的内容:
|
||||
|
||||
`unzip -l {{路径/到/压缩文件.zip}}`
|
||||
|
||||
- 从指定压缩包中提取特定文件:
|
||||
|
||||
`unzip -j {{路径/到/压缩文件.zip}} {{路径/到/文件1 路径/到/文件2 ...}}`
|
Loading…
Add table
Reference in a new issue