The cal command is a simple yet powerful tool that allows you to view calendars directly in the terminal of any Linux distribution. Although it may seem like a minor utility at first glance, its usefulness becomes evident when you need to quickly check dates, plan tasks, or simply verify the day of the week for an event without leaving the command line.
What is the cal command?
Originating from Unix systems, cal belongs to the set of basic utilities that come preinstalled in practically all modern distributions. Its main function is to print a monthly or yearly calendar in text format, taking advantage of the terminal width to present the information clearly and legibly. It requires no external dependencies and its resource consumption is virtually nil.
Basic Syntax
The simplest way to invoke cal is to run it without arguments:
cal
This will display the calendar for the current month, highlighting today’s day. If you wish to consult a specific month and year, simply provide the numeric values:
cal month year
For example, cal 9 2025 will display September 2025. It is also possible to request the full calendar for a year using the -y option or simply by providing the year as the sole argument:
cal 2025
cal -y 2025
Both forms produce an output of twelve months, each in its own block.
Usage Examples
- Display the calendar for the current month:
cal - View February 2024:
cal 2 2024 - Obtain the full calendar for 2023:
cal 2023 - Show three consecutive months (previous, current, and next) using the
-3option:cal -3 - Display the week number alongside each date using
-w:cal -w
Useful Options
-1: Forces display of a single month (default value).-3: Shows the previous month, current month, and next month.-s: Considers Sunday as the first day of the week (BSD compatibility).-m: Considers Monday as the first day of the week (default in most GNU versions).-j: Displays the Julian day (day of the year) instead of the conventional number.-y: Displays the full calendar for the specified year.-w: Prints the ISO week
This post is also available in ESPAÑOL.