How to Display a Calendar in Your Linux Terminal with Cal

Using the Linux terminal can be so fun that you might lose track of what day it is. Fortunately, there’s a Linux command for displaying a calendar in your terminal. Cal is a standard Linux command that prints an ASCII calendar for the specified month and year.

In this article, we will talk in brief about Cal, the various options associated with the utility, and how you can use Cal to display calendars on your Linux machine.

Basic Calendars with Cal

To see a basic calendar of the current month, just type:

cal

In this implementation, the current day is highlighted. In this case, it was March 16, 2021, when the screenshot was taken.

Related: What Is Unix Time and When Was the Unix Epoch?

Different Calendar Options

The real functionalities come with the various options that Cal provides to the users. The version covered in this article is the FreeBSD version of Cal included with Ubuntu. If you use another distribution, your version of the Cal command may be different. To see the manual page for your system, type:

man cal

To see the calendar for the last three months, type:

cal -3

Using the -y flag with Cal will output the calendar for the entire year. The -y stands for Year.

cal -y

To see the calendar for any other year, in this case, perhaps the one you’d rather forget, type:

cal -y 2020

You can also see calendars for a particular month and year:

cal month year

Just replace month and year with the number of the month and year, such as 3 for March, and the year will be the year in four digits, such as 2021. If you live in a country that orders dates differently, you will have to deal with it. This is an artifact of the original Unix system being developed in the US.

For example, here’s the calendar for March 1973. March 1 of that year is a very important anniversary. It’s the date that Pink Floyd’s “Dark Side of the Moon” was released.

Invoking Cal as ncal in Ubuntu provides you with more options, such as the -S and -M flags to have the first day of the week start on a Sunday or a Monday respectively.

Related: Organize Your Time with These 4 Linux Calendar Apps

What’s Up with September 1752?

If you look at the calendar for September 1752 by typing cal 9 1752, you might notice something strange.

The days in September jump from the 2nd to the 14th. And no, this is not a bug. This is because that’s when Great Britain and its colonies (including what eventually became Canada and the US) switched from the Julian calendar to the Gregorian Calendar, which is still used in the West today.

Yes, they just decided to skip 11 whole days! And you thought changing clocks for daylight saving time in places that observe it was annoying!

Linux Commands Have Lots of Options

Even the most basic Linux commands have lots of options that you don’t even know about. It pays to read the manual pages in order to discover new features that might make things easier for you.

If manual pages seem a bit daunting to you because of the length of the content, then luckily, several packages are available for Linux that offer the choice to shorten manual pages in order to make them more readable.

Source: makeuseof.com

Related posts

These 5 iPhone Features Helped Me Minimize Distractions at Work

Network Not Available on Your Chromebook? Follow These 6 Fixes

The Best Bluetooth Headsets of 2024