Install
# RHEL / Alma / Rocky sudo dnf install util-linux # Debian / Ubuntu sudo apt install util-linux # openSUSE sudo zypper install util-linux # Arch sudo pacman -S util-linux
What it does
cal prints a simple calendar to your terminal—by default, the current month. It can also show a full year, specific months, and alternative layouts (via ncal on many systems).
How it works (mechanical)
- Uses your system locale/timezone to determine “today”.
- Formats month and weekday headings in a fixed-width layout.
- Supports options for year view, adjacent months, week numbers, and date numbering styles.
- Often installed as part of util-linux (along with ncal).
Quick Start
# Show the current month cal # Show the current year cal -y
10 Practical Examples
# 1) Current month (default) cal
# 2) Show a full year cal -y
# 3) Specific month and year cal 2 2026
# 4) Three-month view (previous/current/next) cal -3
# 5) Show week numbers cal -w
# 6) Julian day numbers (day-of-year) cal -j
# 7) Monday as first day of week cal -m
# 8) Show the next 2 months after the current month cal -A 2
# 9) Show 1 month before and 2 months after a given month cal -B 1 -A 2 11 2026
# 10) Try the alternative layout (ncal) if available ncal -b
Notes & Gotchas
- Some distros ship both cal and ncal; others may only provide one.
- Options can vary slightly between implementations (GNU vs BSD-style); check man cal on your system.
- Week-number output and week-start behavior depend on build options and locale.
- If cal is missing on older Debian/Ubuntu installs, try installing bsdmainutils (legacy) or util-linux (modern).
- For scripting or date math, prefer date rather than parsing calendar output.
Historical Context
The cal utility dates back to early Unix and BSD systems as a quick way to display a monthly calendar without leaving the terminal. It became a familiar companion to tools like date and cron.
Modern Equivalent
Modern equivalents include terminal TUI calendars, desktop calendars, and online scheduling tools, but cal remains handy for quick “what day is…” checks and lightweight planning—especially over SSH.
Related Commands
- ncal — alternative calendar layout (often installed alongside cal).
- date — display or set the system date/time.
- timedatectl — view/change time settings on systemd systems.
- cron / crontab — schedule recurring jobs.
- at — schedule a one-time job.