用途:BusyBox 是一个单一二进制文件,实现了许多常见 Unix 工具。本技能说明如何在 Windows 上使用 BusyBox 的 Win32 构建版本来运行这些标准 UNIX 命令行工具。仅适用于 Windows;若在 UNIX 上则无需使用。
主要能力:通过一个 busybox.exe 提供多种 UNIX 命令,可用 busybox.exe --list 查看可用命令列表。
使用方式:仅当本文档同目录下找不到 busybox.exe 时才执行以下步骤。这些是 PowerShell 命令;若使用经典 cmd.exe 终端,需用 powershell -Command "..." 运行。
查看 CPU 类型:Get-CimInstance -ClassName Win32_Processor | Select-Object Name, NumberOfCores, MaxClockSpeed
查看 OS 版本:Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" | Select-Object ProductName, DisplayVersion, CurrentBuild
按平台下载 BusyBox: 32 位 x86(ANSI):$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://frippery.org/files/busybox/busybox.exe -OutFile busybox.exe 64 位 x86(ANSI):$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://frippery.org/files/busybox/busybox64.exe -OutFile busybox.exe 64 位 x86(Unicode):$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://frippery.org/files/busybox/busybox64u.exe -OutFile busybox.exe 64 位 ARM(Unicode):$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest -Uri https://frippery.org/files/busybox/busybox64a.exe -OutFile busybox.exe
常用命令:帮助与可用 UNIX 命令列表均为 busybox.exe --list。用法:在 UNIX 命令前加 busybox.exe,例如 busybox.exe ls -1。若需在其他工作目录下运行 UNIX 命令,请使用 busybox.exe 的绝对路径。
文档:https://frippery.org/busybox/ ;原始 BusyBox:https://busybox.net/
适用场景:在 Windows 上需要执行 UNIX 命令行工具的工作流或操作时。
限制:仅限 Windows;资料未提供其他平台支持、收费或价格信息。