用 cal 在终端里查看日历

用 macOS 自带的 cal 命令,在终端里直接打印本月或全年的文本日历。

macOS时间终端低风险
运行 cal 显示当前月份的日历,运行 cal -y 显示今年全部十二个月。

01命令

命令
$ cal -y

02作用说明

cal 是一个极小的内置工具,打印 ASCII 日历:直接运行 cal 会高亮今天所在的月份,cal 12 2026 显示 2026 年 12 月,cal -y 打印整年,方便浏览安排。如果习惯一周从周一开始,加 -m 即可。它不依赖网络也不必打开应用,适合快速查日期,还能写进脚本或登录问候语里。

03风险

风险低风险

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • CAL(1) - macOS manual page
    Apple (Xcode man pages mirror) · vendor-doc · 2026-09-17
    依据: The manual page describes cal as displaying a calendar, with -y for the current year and a month/year argument form.
  • cal - Display a calendar
    SS64 · technical · 2026-09-17
    依据: Documents cal's options including -y to display a calendar for the current year and -m to start weeks on Monday.

最后验证: 2026-09-19 · 分类: 系统与设置

06相关方案