cal
Overview
cal displays a calendar in the terminal — current month by default, or a specific month/year. Handy for quick date context, scripting reminders, and verifying week boundaries. Some systems ship ncal with alternate layouts.
Syntax
cal [options] [[[day] month] year]
cal [options] [[month] year]
cal [options] -y [year]Exact syntax variants exist between util-linux cal and BSD-style cal/ncal.
Common Options (util-linux / common)
| Option | Description |
|---|---|
-1 / -3 |
One month / three months |
-y |
Whole year |
-m |
Monday as first day of week |
-s |
Sunday first (when supported) |
-w |
Week numbers |
-j |
Julian day numbers |
-A n / -B n |
Months after / before |
-h |
Highlight off (or help, depending on version) |
--color |
Colorize today (newer) |
Check cal --help on your host.
Examples with Explanations
Current month
cal
cal -3
cal -m
cal -wSpecific month / year
cal 12 2026
cal 2026
cal -y 2026Week numbers for planning
cal -w
cal -mw 9 2026Surrounding months
cal -A 1 -B 1
cal -3Historical curiosity
cal 9 1752 # UK calendar reform month (implementation-dependent)Scripts: parse carefully
# better for machine dates:
date +%F
date +%V # ISO week
# use cal for human display onlyncal alternative
ncal
ncal -b
ncal -wNotes / Pitfalls
- Highlighting “today” depends on terminal and build options.
- Week-start Monday/Sunday differs by locale and flags — be explicit with
-mwhen it matters. - Do not parse
caloutput for business logic; usedateand proper libraries. - Year range limits differ; very ancient/future years may error.
- BusyBox
calis minimal.
2026-relevant notes
- ISO week numbers (
date +%V,cal -w) still matter for release trains and on-call rotations. - Prefer
datefor automation; keepcalas a human aid over SSH. - Terminal Unicode width issues can misalign rare locales.
Additional Resources
man cal,man ncal