1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 01:02:09 +02:00

glances, hostname, w, iptables, lsblk, reboot, date, at, poweroff, open: update outdated Chinese pages (#16047)

Co-authored-by: Managor <42655600+Managor@users.noreply.github.com>
This commit is contained in:
Ziqiang Wu 2025-04-12 15:49:41 +08:00 committed by GitHub
parent 1bb67128e9
commit 2e78c67026
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 90 additions and 38 deletions

View file

@ -4,10 +4,6 @@
> 结果将被发送到用户的邮箱。
> 更多信息:<https://manned.org/at>.
- 启动 `atd` 守护进程:
`systemctl start atd`
- 交互式创建命令并在 5 分钟后执行(完成后按 `<Ctrl d>`):
`at now + 5 minutes`
@ -23,3 +19,11 @@
- 在下周二晚上 9:30 从指定文件执行命令:
`at -f {{路径/到/文件}} 9:30 PM Tue`
- 列出当前用户的所有待执行任务(等同于 `atq`):
`at -l`
- 查看指定任务:
`at -c {{任务编号}}`

View file

@ -3,22 +3,30 @@
> 一个跨平台的系统监控工具。
> 更多信息:<https://nicolargo.github.io/glances/>.
- 启动 glances,实时显示系统状态:
- 在终端中运行
`glances`
- 以网页服务器模式启动,在浏览器中查看监控数据
- 以网页服务器模式运行,在浏览器中查看结果
`glances -w`
`glances {{[-w|--webserver]}}`
- 以服务器模式启动,允许其他 glances 客户端连接以查看数据:
`glances -s`
`glances {{[-s|--server]}}`
- 作为客户端连接到 glances 服务器:
`glances -c {{主机名或IP地址}}`
`glances {{[-c|--client]}} {{主机名}}`
- 在(网页)服务器模式下启用密码保护:
`glances -s --password`
`glances {{[-s|--server]}} --password`
- 退出Glances:
`<q>`
- 显示帮助信息:
`glances {{[-h|--help]}}`

View file

@ -9,15 +9,11 @@
- 显示主机名的网络地址:
`hostname -i`
- 显示主机的所有网络地址:
`hostname -I`
`hostname {{[-i|--ip-addresses]}}`
- 显示 FQDN(完全限定域名):
`hostname --fqdn`
`hostname {{[-f|--fqdn]}}`
- 设置本机主机名:

View file

@ -1,13 +1,20 @@
# w
> 显示有哪些用户登录了本机以及他们当前的活动。
> 打印用户登录,TTY, 远程主机,登录时间,闲置时间,当前进程。
> 显示已登录用户及其进程信息。
> 更多信息:<https://manned.org/w>.
- 获取已登录用户信息:
- 显示所有当前已登录用户的信息:
`w`
- 无标题栏模式
- 显示指定用户的信息
`w -h`
`w {{用户名}}`
- 显示已登录用户信息,但不显示标题行:
`w {{[-h|--no-header]}}`
- 显示信息时不包含登录时间、JCPU 和 PCPU 列:
`w {{[-s|--short]}}`

View file

@ -1,6 +1,7 @@
# iptables
> 可用于配置 Linux 内核防火墙提供的过滤表、规则链和规则的程序。
> 使用 `ip6tables` 来设置 IPv6 流量规则。另见:`iptables-save``iptables-restore`
> 更多信息:<https://manned.org/iptables>.
- 查看过滤表的规则链、规则以及数据包/字节计数器:
@ -19,14 +20,10 @@
`sudo iptables {{[-A|--append]}} {{规则链}} {{[-s|--source]}} {{ip}} {{[-p|--protocol]}} {{协议}} --dport {{端口}} {{[-j|--jump]}} {{规则}}`
- 添加 NAT 规则,将来自 `192.168.0.0/24` 子网的所有流量转换为主机的公共 IP:
`sudo iptables {{[-t|--table]}} {{nat}} {{[-A|--append]}} {{POSTROUTING}} {{[-s|--source]}} {{192.168.0.0/24}} {{[-j|--jump]}} {{MASQUERADE}}`
- 删除规则链中的规则:
`sudo iptables {{[-D|--delete]}} {{规则链}} {{规则所在行号}}`
- 将指定过滤表的 iptables 配置保存到文件中:
`sudo iptables-save {{[-t|--table]}} {{过滤表名}} > {{iptables_文件路径}}`
- 从文件中还原 iptables 配置:
`sudo iptables-restore < {{iptables_文件路径}}`

View file

@ -19,6 +19,10 @@
`lsblk {{[-f|--fs]}}`
- 使用 ASCII 字符进行树形格式化:
`lsblk {{[-i|--ascii]}}`
- 输出块设备的拓扑结构:
`lsblk {{[-t|--topology]}}`
@ -29,4 +33,4 @@
- 使用逗号分隔的列列表显示自定义摘要:
`lsblk {{[-o|--output]}} {{NAME,SERIAL,MODEL,TRAN,TYPE,SIZE,FSTYPE,MOUNTPOINT,...}}`
`lsblk {{[-o|--output]}} {{名称,序列号,型号,传输方式,类型,大小,文件系统类型,挂载点,...}}`

View file

@ -5,4 +5,20 @@
- 关闭系统电源:
`sudo poweroff`
`poweroff`
- 停止系统(等同于 `halt`):
`poweroff --halt`
- 重启系统(等同于 `reboot`):
`poweroff --reboot`
- 立即关机,不联系系统管理器:
`poweroff {{[-f|--force]}}`
- 仅写入 wtmp 关机日志条目而不关闭系统:
`poweroff {{[-w|--wtmp-only]}}`

View file

@ -3,10 +3,22 @@
> 重新启动系统。
> 更多信息:<https://manned.org/reboot.8>.
- 立即重新启动
- 重启系统
`reboot`
- 关闭系统(等同于 `poweroff`):
`reboot {{[-p|--poweroff]}}`
- 停止系统(终止所有进程并关闭 CPU,等同于 `halt`):
`reboot --halt`
- 立即重启,而无需正常关闭:
`reboot {{[-f|--force]}}`
- 仅写入 wtmp 关机日志条目而不重启系统:
`reboot {{[-w|--wtmp-only]}}`

View file

@ -18,3 +18,7 @@
- 使用默认格式显示特定日期(格式化指定 UNIX 时间戳):
`date -r {{1473305798}}`
- 使用默认格式显示相对于当前日期的日期:
`date -v {{+1d}} -v {{-20m}}`

View file

@ -5,15 +5,15 @@
- 使用系统关联的应用程序打开文件:
`open {{filename.extension}}`
`open {{文件名.扩展名}}`
- 运行图形化的 macOS 应用程序:
`open -a {{应用程序名}}`
`open -a "{{应用程序名}}"`
- 运行指定 包名 的图形化 macOS 应用程序(请参阅`OSascript`命令,查询如何获取应用程序的 包名):
- 运行指定包标识符的图形化 macOS 应用程序(请参阅`OSascript`命令,查询如何获取应用程序的包标识符):
`open -b {{com.domain.application 应用程序包名}}`
`open -b {{com.domain.application}}`
- 在"访达(finder)"中打开当前文件夹:
@ -21,8 +21,12 @@
- 打开"访达(finder)", 并且给出指定文件:
`open -R {{文件路径}}`
`open -R {{路径/到/文件}}`
- 使用系统默认应用程序,打开当前目录中所有给定扩展名的文件:
`open {{*.extension}}`
`open {{*.扩展名}}`
- 通过包标识符打开应用程序的新实例:
`open -n -b {{com.domain.application}}`