cal — Display a calendar
Linux / Basic Linux commands / cal.html
Prints a calendar for a month or a year in the terminal.
Basic Information
| Command Name | cal |
|---|---|
| One-line Introduction | Prints a calendar for a month or a year in the terminal. |
| Provided by | util-linux (ncal) |
| Official Documentation | https://man7.org/linux/man-pages/man1/cal.1.html |
| Supported Operating Systems | Linux, macOS, BSD |
| Installation Status | Installed by default |
| Category | Linux basic commands (tags: Linux basic commands (tags: cal, calendar, date, ncal)) |
What is this command?
cal prints the current month. Pass a year or month and year to view that period, and -3 shows the previous, current and next month together.
Many distributions ship ncal too, enabling Monday-first layouts (-m) and a full-year view (-y). For date arithmetic in scripts, use date instead.
What problems does it solve?
- Checking dates and weekdays quickly in a terminal
- Viewing the layout of a specific month
- Scanning a full year calendar
- Confirming date formats while writing docs
Key features
Month view
With no arguments it shows the current month.
- When to use: Checking today's date and weekday
- What you get: The layout is visible at a glance.
- Limitations: Public holidays are not included.
Year view
-y or a year argument prints all twelve months.
- When to use: Planning across a year
- What you get: You can see the whole year.
- Limitations: Output is long and may need a pager.
Week start
-m starts weeks on Monday.
- When to use: When a Monday-first layout is expected
- What you get: It matches common document conventions.
- Limitations: Option support varies by implementation.
Installation and usage
Check whether it is installed
cal --version
sudo apt install util-linux # Debian/Ubuntu sudo dnf install util-linux # Fedora
Real-world examples
This month
Show the current month.
cal
Specific month
Show October 2026.
cal 10 2026
Full year
Print the whole year.
cal -y 2026 | head -n 20