pages.zh: update outdated pages (#11939)

This commit is contained in:
Sebastiaan Speck
2024-01-01 10:38:53 +01:00
committed by GitHub
parent ef0f5499ad
commit 81ddb70476
59 changed files with 125 additions and 205 deletions

View File

@@ -6,24 +6,24 @@
- 显示给定音频文件的详细信息:
`afinfo {{目标 / 路径 / 文件}}`
`afinfo {{路径/到/文件}}`
- 显示简化的音频文件信息(单行):
`afinfo -b {{目标 / 路径 / 文件}}`
`afinfo --brief {{路径/到/文件}}`
- 显示音频文件的元数据信息以及其 InfoDictionary 词典:
`afinfo -i {{目标 / 路径 / 文件}}`
`afinfo --info {{路径/到/文件}}`
- 以 xml 格式显示音频文件信息:
`afinfo -x {{目标 / 路径 / 文件}}`
`afinfo --xml {{路径/到/文件}}`
- 显示警告信息(如存在):
`afinfo --warnings {{目标 / 路径 / 文件}}`
`afinfo --warnings {{路径/到/文件}}`
- 显示完整用法帮助:
`afinfo -h`
`afinfo --help`

View File

@@ -5,7 +5,7 @@
- 显示当前的无线状态信息:
`airport -I`
`airport --getinfo`
- 在通道 1 上监察(嗅探)无线流量:
@@ -13,8 +13,8 @@
- 扫描可用的无线网络:
`airport -s`
`airport --scan`
- 与当前的 Airport 网络脱离连接:
`sudo airport -z`
`sudo airport --disassociate`

View File

@@ -6,15 +6,15 @@
- 将磁盘映像复制到目标卷:
`sudo asr restore --source {{映像名}}.dmg --target {{卷路径}}`
`sudo asr restore --source {{映像名.dmg}} --target {{卷路径}}`
- 在复制之前擦除目标卷:
`sudo asr restore --source {{映像名}}.dmg --target {{卷路径}} --erase`
`sudo asr restore --source {{映像名.dmg}} --target {{卷路径}} --erase`
- 恢复后跳过验证步骤:
`sudo asr restore --source {{映像名}}.dmg --target {{卷路径}} --noverify`
`sudo asr restore --source {{映像名.dmg}} --target {{卷路径}} --noverify`
- 不使用中间磁盘映像直接复制卷中的数据:

View File

@@ -13,7 +13,7 @@
- 通过标准输入管道进行解码:
`echo -n {{目标字符串}} | base64`
`echo -n "{{目标字符串}}" | base64`
- 解码标准输入管道内容:

View File

@@ -5,8 +5,8 @@
- 用证书签名:
`codesign -s "{{公司名称}}" {{路径 / 应用名.app}}`
`codesign --sign "{{公司名称}}" {{路径 / 应用名.app}}`
- 验证应用程序的签名:
`codesign -v {{路径 / 应用名.app}}`
`codesign --verify {{路径 / 应用名.app}}`

View File

@@ -5,11 +5,11 @@
- 使用默认区域设置的格式显示当前日期:
`date +"%c"`
`date +%c`
- 以 UTC 和 ISO 8601 格式显示当前日期:
`date -u +"%Y-%m-%dT%H:%M:%SZ"`
`date -u +%Y-%m-%dT%H:%M:%SZ`
- 将当前日期显示为 unix 时间戳(自 1970-01-01 00:00:00 以来的秒数):

View File

@@ -25,4 +25,4 @@
- 列出当前目录子目录中所有.jpg 文件的可读大小,并在末尾显示累计总数:
`du -ch */*.jpg`
`du -ch {{*/*.jpg}}`

View File

@@ -13,7 +13,7 @@
- 将 Finder 设置为 ftp:// URL 访问的应用:
`duti -s {{com.apple.Finder}} {{ftp}}`
`duti -s {{com.apple.Finder}} "{{ftp}}"`
- 显示有关给定扩展名的默认应用程序的信息:

View File

@@ -5,7 +5,7 @@
- 调试可执行文件:
`lldb {{可执行的命令}}`
`lldb "{{可执行的命令}}"`
-`lldb` 附加到具有给定 PID 的正在运行的进程:
@@ -13,4 +13,4 @@
- 等待使用给定名称的进程启动,然后附加到该进程上:
`lldb -w -n {{进程名}}`
`lldb -w -n "{{进程名}}"`

View File

@@ -5,7 +5,7 @@
- 在数据库中查找关键字。注意:数据库定期重新更新(通常每周或每天):
`locate {{关键字}}`
`locate "{{关键字}}"`
- 按文件名查找文件(不包含填充字符的模式被解释为 `*关键字*`

View File

@@ -9,4 +9,4 @@
- 查找行,忽略大小写:
`look -f {{前缀}} {{文件}}`
`look --ignore-case {{前缀}} {{文件}}`

View File

@@ -5,7 +5,7 @@
- 首次登录 Mac 应用商店:
`mas signin {{user@example.com}}`
`mas signin "{{user@example.com}}"`
- 显示所有已安装的应用程序和它们的产品标识符:
@@ -13,7 +13,7 @@
- 搜索一个应用程序,在结果旁边显示价格:
`mas search {{应用程序}} --price`
`mas search "{{应用程序}}" --price`
- 安装或更新一个应用程序:

View File

@@ -17,4 +17,4 @@
- 打印给定字符串的 MD5 校验值:
`md5 -s {{字符串}}`
`md5 -s "{{字符串}}"`

View File

@@ -9,8 +9,8 @@
- 按内容查找文件:
`mdfind {{查找的字符串}}`
`mdfind "{{查找的字符串}}"`
- 在给定目录中查找包含字符串的文件:
`mdfind -onlyin {{目录}} {{字符串}}`
`mdfind -onlyin {{目录}} "{{字符串}}"`

View File

@@ -17,4 +17,4 @@
- 连接到给定的 Wi-Fi 网络 Connect to a particular Wi-Fi network
`networksetup -setairportnetwork {{en0}} "{{无线网 SSID}}" {{密码}}`
`networksetup -setairportnetwork {{en0}} {{无线网 SSID}} {{密码}}`

View File

@@ -9,7 +9,7 @@
- 跟踪给定进程名,打开的所有文件:
`sudo opensnoop -n {{进程名}}`
`sudo opensnoop -n "{{进程名}}"`
- 跟踪给定 PID进程号打开的所有文件

View File

@@ -5,11 +5,11 @@
- 运行一个 AppleScript 命令:
`osascript -e '{{say "你好世界"}}'`
`osascript -e "{{say '你好世界'}}"`
- 运行多条 AppleScript 命令:
`osascript -e '{{say "你好"}}' -e '{{say "世界"}}'`
`osascript -e "{{say '你好'}}" -e "{{say '世界'}}"`
- 运行一个已编译的脚本(`*.scpt`),包脚本(`*.scptd`),或明文的(`*.applescript`AppleScript 文件:
@@ -21,7 +21,7 @@
- 运行一个 JavaScript 命令:
`osascript -l JavaScript -e '{{console.log("你好世界!");}}'`
`osascript -l JavaScript -e "{{console.log('你好世界!');}}"`
- 运行 JavaScript 文件:

View File

@@ -5,24 +5,24 @@
- Ping 指定的主机:
`ping {{主机}}`
`ping "{{主机}}"`
- 对主机执行指定定次数的 ping 操作:
`ping -c {{次数}} {{主机}}`
`ping -c {{次数}} "{{主机}}"`
- Ping `主机` , 指定请求之间的间隔(以`秒`为单位)(默认为 1 秒):
`ping -i {{秒}} {{主机}}`
`ping -i {{秒}} "{{主机}}"`
- Ping `主机`, 但不尝试查找地址的符号名:
`ping -n {{主机}}`
`ping -n "{{主机}}"`
- Ping `主机` 并在收到数据包时响铃(如果您的终端支持):
`ping -a {{主机}}`
`ping -a "{{主机}}"`
- Ping `主机` 并打印接收数据包的时间(此选项是 Apple 的附加项):
`ping --apple-time {{主机}}`
`ping --apple-time "{{主机}}"`

View File

@@ -6,15 +6,15 @@
- 通过网关向目标添加路由:
`sudo route add {{路由 ip 地址}} {{网关地址}}`
`sudo route add "{{路由 ip 地址}}" "{{网关地址}}"`
- 通过网关向 子网 / 24 添加路由:
`sudo route add {{子网 ip}}/24 {{网关地址}}`
`sudo route add "{{子网 ip}}/24" "{{网关地址}}"`
- 在测试模式下运行(不做任何操作,只打印):
`sudo route -t add {{路由 ip 地址}}/24 {{网关地址}}`
`sudo route -t add "{{路由 ip 地址}}/24" "{{网关地址}}"`
- 删除所有路由:
@@ -22,8 +22,8 @@
- 删除特定路由:
`sudo route delete {{路由 ip 地址}}/24`
`sudo route delete "{{路由 ip 地址}}/24"`
- 查找并显示目标的路由(主机名或 IP 地址):
`sudo route get {{目标}}`
`sudo route get "{{目标}}"`

View File

@@ -9,12 +9,12 @@
- 只输出结果的前 5 条:
`shuf -n {{5}} {{文件名}}`
`shuf --head-count={{5}} {{文件名}}`
- 将结果输出写入另一个文件:
`shuf {{文件名}} -o {{输出_文件名}}`
`shuf {{文件名}} --output={{输出_文件名}}`
- 生成范围1-10内的随机数
`shuf -i {{1-10}}`
`shuf --input-range={{1-10}}`

View File

@@ -17,7 +17,7 @@
- 倒计时 5 分钟重启:
`shutdown -r +{{5}}`
`shutdown -r "+{{5}}"`
- 在下午 1:00使用 24 小时时钟)关机:

View File

@@ -10,11 +10,11 @@
- 以指定的大小对图像重新采样,图像纵横比可能会更改:
`sips -z {{1920}} {{300}} {{图片文件。扩展名}}`
`sips --resampleHeightWidth {{1920}} {{300}} {{图片文件。扩展名}}`
- 对图像重新取样,使高度和宽度不大于指定的大小(注意大写 Z
`sips -Z {{1920}} {{300}} {{图片文件。扩展名}}`
`sips --resampleHeightWidthMax {{1920}} {{300}} {{图片文件。扩展名}}`
- 对目录中的所有图像重新取样,以适应 960px 的宽度(保持纵横比):
@@ -22,8 +22,8 @@
- 将图像从 CMYK 转换为 RGB
`sips --matchTo '/System/Library/ColorSync/Profiles/Generic RGB Profile.icc' {{目标 / 文件夹 / 图片。扩展}} {{目标 / 文件夹 / 输出文件夹}}`
`sips --matchTo "/System/Library/ColorSync/Profiles/Generic RGB Profile.icc" {{目标 / 文件夹 / 图片。扩展}} {{目标 / 文件夹 / 输出文件夹}}`
- 从图像中删除 ColorSync ICC 配置:
`sips -d profile --deleteColorManagementProperties {{目标 / 文件夹 / 图片。扩展}}`
`sips --deleteProperty profile --deleteColorManagementProperties {{目标 / 文件夹 / 图片。扩展}}`

View File

@@ -5,16 +5,16 @@
- 列出所有可用的更新:
`softwareupdate -l`
`softwareupdate --list`
- 下载并安装所有更新:
`softwareupdate -ia`
`softwareupdate --install --all`
- 下载并安装所有推荐的更新:
`softwareupdate -ir`
`softwareupdate --install --req`
- 下载并安装特定的应用程序:
`softwareupdate -i {{更新应用程序名}}`
`softwareupdate --install {{更新应用程序名}}`

View File

@@ -9,7 +9,7 @@
- 指定时区、NTP 服务器并启用网络时间:
`systemsetup -settimezone {{美国 / 太平洋}} -setnetworktimeserver {{us.pool.ntp.org}} -setusingnetworktime on`
`systemsetup -settimezone "{{美国 / 太平洋}}" -setnetworktimeserver {{us.pool.ntp.org}} -setusingnetworktime on`
- 使机器从不休眠,并在电源故障或内核死机时自动重新启动:

View File

@@ -9,11 +9,11 @@
- 录制视频:
`wacaw --video {{文件名}} -D {{录制多少秒}}`
`wacaw --video {{文件名}} --duration {{录制多少秒}}`
- 用自定义分辨率拍照:
`wacaw -x {{宽}} -y {{高}} {{文件名}}`
`wacaw --width {{宽}} --height {{高}} {{文件名}}`
- 将刚拍摄的图像复制到剪贴板:
@@ -21,4 +21,4 @@
- 可用设备列表:
`wacaw -L`
`wacaw --list-devices`

View File

@@ -9,4 +9,4 @@
- 将值传递给样式表中的参数:
`xsltproc --output {{输出.html}} --stringparam {{键名}} {{值}} {{样式表.xslt}} {{xml 文件.xml}}`
`xsltproc --output {{输出.html}} --stringparam "{{键名}}" "{{值}}" {{样式表.xslt}} {{xml 文件.xml}}`