How to Show the Calendar in the Linux Terminal

While the Linux command line is usually reserved for complex system administration tasks, editing configuration files, and managing network routing, it also contains several small, lightweight utilities designed for everyday convenience.

If you are actively working in the terminal and need to quickly check what day of the week a specific date falls on, you do not need to reach for your mouse, open a web browser, or launch a heavy graphical calendar application. You can simply use the built-in cal command to print a perfectly formatted calendar directly to your screen.

How to Display the Current Month

The cal (calendar) utility is pre-installed on virtually every Linux distribution, including Ubuntu, Debian, and CentOS.

To use it, simply open your terminal and type the command by itself:

cal

Press Enter, and the terminal will instantly output a clean, minimalist grid representing the current month. The current day will be distinctly highlighted (usually by reversing the text color or highlighting it in white).

How to View the Entire Year

If you need to look ahead to plan a vacation or verify a schedule for the upcoming winter, viewing a single month is not very helpful. You can force the command to display all twelve months of the current year simultaneously.

Type the following command:

cal -y

The terminal will output a beautiful, three-column grid containing the entire calendar year.

How to View a Specific Month in the Past or Future

The cal command is actually a perpetual calendar. It can accurately generate a calendar grid for almost any year in recorded history.

The syntax requires you to specify the month (as a number between 1 and 12) followed by the four-digit year.

For example, if you wanted to see what the month looked like when the original Macintosh computer was released in January 1984, you would type:

cal 1 1984

The terminal will instantly print the calendar for January 1984.

If you wanted to jump forward and see what day of the week Christmas will fall on in the year 2050, you would search for December 2050 by typing:

cal 12 2050

How to View Three Months at Once

A very common workflow requirement is needing to see the previous month, the current month, and the next month simultaneously to understand a quarterly timeline.

Instead of running the command three separate times, you can use the -3 flag (three months):

cal -3

The terminal will neatly print the previous, current, and upcoming month side-by-side in a single row, providing excellent context for scheduling without overwhelming your screen with an entire year of data.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.