In the Linux Crash Course series, you’ll learn a valuable Linux-related command or skill – one video at a time. In this video, we explore the cal command.
LCC – The cal command
Hello and welcome back to Learn Linux TV!
Today I have another episode of my Linux Crash Course series for you guys, and this series teaches you just about everything you’ve ever wanted to know about Linux, one video / article at a time. And unless I tell you otherwise, the episodes in this series can be watched / read in any order.
This time around, I have a very easy command for you to learn. The cal command. Short for calendar, it lets you display a calendar right inside your Linux terminal, and there’s also some options I’m going to give you as well in order to customize the output.
And the cal command is very easy to learn, in fact this might be one of the easiest articles in the entire series.
I’ll show you all about the command shortly, but for now, I need to take a moment and mention the sponsor for today’s article.
Thank you so much for supporting Learn Linux TV! Now, it’s time to learn the cal command.
Basic Usage
Alright, so let’s get started.
First, we need to make sure we have the cal command available to us.
command -v cal
If we don’t have the command available, we’ll need to install it.
For Debian, Ubuntu, and other systems with the APT package manager, we can install ncal:
sudo apt update
sudo apt install ncal
If you’re using Arch, Fedora, or Enterprise Linux, the package you’re looking for is util-linux.
Once you have it installed, the most basic usage of the cal command is to simply enter it without any options, and what that will do is display the calendar for the current month.
cal
If you’d like to see the calendar for the entire year, you can use the -y option:
cal -y
If you’d like to see the calendar for a different year, simply add the year you’re curious about after the cal command, like this:
cal 1982
In addition to that, if you’d like to look up a spefici specific month of a specific year:
cal 8 1982
Another trick you can use with the cal command is to view three months at a time. You can do that with the -3 option:
cal -3
Also, you can use the -1 option to view a single month:
cal -1
But that option is relatively useless since you’d get the same output if you omitted it altogether:
cal


