用 lpstat 命令查看 Mac 上已安装的打印机和打印队列
lpstat 可以在终端里列出 Mac 上的所有打印机、默认打印机,以及卡在队列里还没打印的任务,不用打开系统设置。
运行 `lpstat -p -d` 可以列出所有已安装的打印机及其状态,再用 `lpstat -o` 查看排队中的打印任务。
01命令
命令
$ lpstat -p -d && echo '--- pending jobs ---' && lpstat -o02作用说明
lpstat 是 macOS 自带的 CUPS 打印状态工具。-p 参数列出每台打印机是空闲、打印中还是已停用;-d 会额外标出系统默认打印机;-o 则按“打印机-任务号”的格式列出所有排队任务,例如 Office_Printer-142。如果打印机在卡纸后显示“已停用”,它不会自动恢复,需要在“系统设置 > 打印机与扫描仪”里重新启用,或用 cupsenable 命令恢复。
03风险
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- lpstat — print status information (macOS man page)依据: Documents lpstat -p (list printers), -d (default printer) and -o (pending jobs) as used in the command.
- cancel — cancel print jobs (macOS man page)依据: Cross-references how pending lpstat -o job IDs can be removed with cancel.
最后验证: 2026-09-18 · 分类: 系统与设置