How to Show the Calendar in Linux Using the cal Command

If you spend your entire workday managing servers through a Linux terminal, opening a separate graphical web browser just to check what day of the week a date falls on breaks your workflow. Linux is designed to keep your hands on the keyboard, which is why it includes a tiny, incredibly fast utility specifically for checking dates: the cal command.

The Basics of the cal Command

The cal (calendar) command is a standard utility built into almost every UNIX and Linux distribution in existence. It takes zero configuration to use.

Simply open your terminal, type the following, and press Enter:

cal

Linux will instantly print a beautifully formatted, text-based calendar of the current month. The current day will be highlighted (usually inverted in color or boxed, depending on your terminal settings), allowing you to glance at the date and immediately return to your command prompt.

How to View a Specific Month or Year

The true power of the cal command is its ability to instantly jump to any point in the past or future.

If you want to see the calendar for an entire year (for example, if you are planning a project timeline for next year), simply type the year after the command:

cal 2025

The terminal will print all twelve months of 2025 in a neat grid.

If you only care about a specific month in a specific year, you provide the month as a number (1-12), followed by the year. For example, to see what day of the week Halloween fell on in the year 1999, you would type:

cal 10 1999

Alternative: The ncal Command

On many modern Linux systems (like Ubuntu), running cal actually runs a slightly modified version called ncal in compatibility mode. The traditional cal command displays weeks horizontally (Sunday through Saturday left to right). The native ncal format flips this, displaying the days vertically (Monday through Sunday top to bottom), which some developers find easier to read in narrow terminal windows.

You can try this alternative layout by typing:

ncal

Regardless of which layout you prefer, both commands are significantly faster than reaching for a mouse to click a clock icon on a graphical desktop.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

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

Receive our best articles and tips delivered straight to your inbox.