Home > Environment & Utility > cal

cal: Display Calendar

The cal command is a utility that displays a calendar for the current month or a specified month and year in the terminal. With simple options, you can view the calendar for the entire year or a specific period.

Overview

cal is a command that allows you to easily view a calendar in the terminal. By default, it shows the calendar for the current month, but you can also specify a particular year or month. It includes leap year calculations to provide accurate calendar information.

Key Features

  • Display current month's calendar
  • Display specific month/year calendar
  • Display entire year calendar
  • Display previous/current/next 3 months calendar
  • Display Julian day numbers

Key Options

The cal command offers several useful options to control how the calendar is displayed.

Display Formats

Start Day of Week

Generated command:

Try combining the commands.

Description:

`cal` Executes the command.

Combine the above options to virtually execute commands with AI.

Usage Examples

Learn how to effectively check calendars through various usage examples of the cal command.

View Current Month's Calendar

cal

Running cal without options displays the calendar for the current month.

View Entire Calendar for a Specific Year

cal 2024

You can view the entire calendar for a specific year by specifying only the year.

View Calendar for a Specific Month and Year

cal 12 2024

Specify both the month and year to display the calendar for that specific month.

View Previous, Current, and Next 3 Months

cal -3

Use the -3 option to display the previous, current, and next months together.

Set Monday as the Start of the Week

cal -m

Use the -m option to change the first day of the week in the calendar to Monday.

View Calendar with Julian Day Numbers

cal -j

Use the -j option to display dates as the day number from January 1st.

Tips & Notes

Although the cal command is simple, it can be usefully employed for quickly checking date information when writing scripts or reports.

Usage Tips

  • Useful for generating and saving the calendar for a specific month to a file in scripts.
  • Can be used with the `date` command to quickly check a specific calendar based on the current date.
  • Helpful for quickly making annual plans or checking specific dates in the terminal.

Notes

The cal command is included by default in most Linux distributions, so no separate installation is required. The output format is automatically adjusted based on the terminal width.


Same category commands