You don't want to lose sight of the days? The Cal command on Linux will help you with this.
Using the Linux Terminal can be so much fun that you may lose track of today. Fortunately, there is 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're going to briefly cover Cal, the various options associated with the utility, and how to use Cal to view calendars on your Linux computer.
Basic calendar with cal
Simply enter the following to view a base calendar for the current month:
In this implementation, the current day is highlighted. In this case, it was March 16, 2021 when the screenshot was taken.
Different calendar options
The real features come with the various options that Cal offers users. The version covered in this article is the FreeBSD version of Cal included with Ubuntu. If you are using a different distribution, your version of the Cal command may be different. Enter the following to display the manual page for your system:
To see the calendar for the last three months, enter:
Use of -y The flag with Cal outputs the calendar for the entire year. The -y stands for year.
To see the calendar for a different year, in this case possibly the one you'd rather forget, type:
cal -y 2020
You can also view calendars for a specific month and year:
cal month year
Just replace it 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 where the orders are different, this is something you need to take care of. This is an artifact of the original Unix system developed in the United States.
For example, here is the calendar for March 1973. March 1st of this year is a very important anniversary. It is the date that Pink Floyd's "Dark Side of the Moon" was released.
Call of Cal as ncal in Ubuntu gives you more options like that -S and -M Flags for the first day of the week start on a Sunday or Monday.
What's up with September 1752?
If you are looking 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, that's not a mistake. This is because Britain and its colonies (including later Canada and the United States) switched from the Julian calendar to the Gregorian calendar, which is still used in the West today.
Yes, they just decided to skip 11 full days! And you thought changing the clocks for summer time in places where this is observed was annoying!
Linux commands have many options
Even the most basic Linux commands offer many options that you may not even know about. It is worth reading the manual pages to discover new features that might make your work easier.
Fortunately, if manual pages seem a little daunting to you because of the length of their content, there are several packages available for Linux that offer the ability to shorten manual pages to make them more readable.
How to shorten man pages into legible explanations on Linux and macOS
MacOS and Linux each have a useful command, "man," which provides manual explanations for terminal commands. Use the tldr tool to shorten them into readable sections as they are often tedious.
About the author
(14 articles published)
David is a freelance writer living in the Pacific Northwest but originally from the Bay Area. He has been a technology enthusiast since childhood. David's interests include reading, watching quality TV shows and movies, retro games, and collecting records.
By David Delony
Subscribe to our newsletter
Sign up for our newsletter to receive tech tips, reviews, free e-books, and exclusive offers!
One more step …!
Please confirm your email address in the email we just sent you.