hexdump, logger, netstat, n, nm, pdfgrep: move to common (#6549)

This commit is contained in:
marchersimon
2021-09-18 23:05:08 +02:00
committed by GitHub
parent f79d8e56e3
commit 442a013cb8
17 changed files with 2 additions and 129 deletions

View File

@@ -0,0 +1,16 @@
# hexdump
> 一个 ASCII十进制十六进制八进制转换查看工具。
> 更多信息:<https://manned.org/hexdump>.
- 打印文件的十六进制表示形式:
`hexdump {{文件}}`
- 以十六进制显示输入偏移量,并在最后两列中显示其 ASCII 表示形式:
`hexdump -C {{文件}}`
- 显示文件的十六进制表示,但只解释输入的 N 个字节:
`hexdump -C -n{{字节数}} {{文件}}`

23
pages.zh/common/logger.md Normal file
View File

@@ -0,0 +1,23 @@
# logger
> 向系统日志增加记录(/var/log/syslog
- 向系统日志增加记录:
`logger {{消息内容}}`
- 从 stdin 获取输入并记录到系统日志 syslog:
`echo {{记录内容}} | logger`
- 将输出发送到在给定端口上运行的远程系统日志服务器。默认端口为 514:
`echo {{记录内容}} | logger -h {{服务器名}} -P {{端口}}`
- 对记录的每一行使用特定的标签。默认值是登录用户的名:
`echo {{记录内容}} | logger -t {{标签}}`
- 以给定的错误等级记录消息。默认是 `user.notice`. 使用 `man logger` 查询所有可选等级:
`echo {{记录内容}} | logger -p {{user.warning}}`

23
pages.zh/common/n.md Normal file
View File

@@ -0,0 +1,23 @@
# n
> 用于管理多个节点版本的工具。
- 安装给定版本的节点。如果版本已经安装,它将被激活:
`n {{版本}}`
- 显示已安装的版本并以交互方式激活其中一个版本:
`n`
- 删除一个版本:
`n rm {{版本}}`
- 使用给定版本执行文件:
`n use {{版本}} {{文件.js}}`
- 输出指定版本的二进制:
`n bin {{版本}}`

View File

@@ -0,0 +1,24 @@
# netstat
> 显示与网络相关的信息,如打开的连接、打开的套接字端口等。
> 更多信息:<https://www.unix.com/man-page/osx/1/netstat>.
- 列出所有端口:
`netstat -a`
- 列出所有被侦听端口:
`netstat -l`
- 列出侦听的 TCP 端口:
`netstat -t`
- 显示监听给定协议监听的 PID 和程序名:
`netstat -p {{协议}}`
- 打印路由表:
`netstat -nr`

View File

@@ -0,0 +1,23 @@
# pdfgrep
> 在 PDF 文件中搜索文本。
- 在 PDF 中查找与关键词匹配的行:
`pdfgrep {{关键词}} {{文件.pdf}}`
- 包含每个匹配行的文件名和页码:
`pdfgrep --with-filename --page-number {{关键词}} {{文件.pdf}}`
- 对以 "foo" 开头关键词搜索,返回前 3 个匹配项,不区分大小写:
`pdfgrep --max-count {{3}} --ignore-case {{'^foo'}} {{文件.pdf}}`
- 在当前目录中扩展名为.pdf 的文件中递归查找关键词:
`pdfgrep --recursive {{关键词}}`
- 在与当前目录中特定文件名 "*book.pdf" 匹配的文件上递归查找关键词:
`pdfgrep --recursive --include {{'*book.pdf'}} {{关键词}}`