/ factorpad.com / tech / linux-essentials / cal-command.html
An ad-free and cookie-free website.
Beginner
Learn to display a monthly or yearly calendar at the Linux command line.
Videos can also be accessed from the Linux Essentials Playlist on YouTube.
Linux cal Command Summary with Examples (2:59)
Our forty-second word, or command to memorize is
cal
from our category
System.
cal
allows you to display a
calendar.
-options | description |
---|---|
-3 |
Show a calendar for three months |
-y |
Display a calendar for the whole year |
Recall from the previous video, we used the
calendar
command to display reminders
and send updates, now with cal
, we
have an easy command offering a calendar view.
Before we start, it helps to think of commands as mini programs and
most follow this structure:
command -option(s) argument(s)
.
The cal
command has
6 options and no arguments.
Unlike most commands, help isn't available with double-dash
--help
, so I suggest using the
man cal
command for
documentation. The default is the current month, and with
-3
view three months, and for the
whole year use the
-y
option.
You can also customize this and get more granular, but I figure you'll use your phone, email program or wall calendar for that.
So why is cal
an important command?
Well, if you're completely focused on the terminal and don't want to
turn your attention away from the screen,
cal
offers a quick way to remember
what the heck day it is.
And now you know how to do that.
Okay, the best way to embed this in your memory is by typing in your own terminal window.
Find this on your Mac using a program called Terminal. On Linux use Terminal or Konsole, and currently Microsoft is adding this functionality to Windows.
Here we go. Let's do a
cal
without options for the current
month.
Next, we'll do a cal
with the minus or
-3
option to add the surrounding two
months.
And last, let's throw in a -y
option
for the whole year.
Okay now you know how to use cal
.
And you know the syntax for commands, options and arguments.
One last tip about the cal
command.
So again, I think cal
is best for a
quick look at a recent month, or few months, but check out the
-m
option in the
man cal
page to review other months,
or years.
Okay, thanks for visiting today. I hope this was a helpful
introduction to the cal
command.
For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:
If you learned something today, please consider subscribing. Every bit of support helps.
calendar
command, hit Back.sleep
command, click Next./ factorpad.com / tech / linux-essentials / cal-command.html
A newly-updated free resource. Connect and refer a friend today.