Linux – Use the Terminal to Display a Calendar

July 13th, 2010 by @HKw@! | Filed under centos, Fedora, Linux, RedHat, Ubuntu.

In Linux environment, we can view the calendar directly in the terminal. To do this, just simply use the “cal” command

cal command is used to display the calendar. Below are the syntax:-

cal [options] [month{1-12}] [year{1-9999}] 

OPTIONS:

-1 Displays single month as output.
-3 Displays prev/current/next month output.
-s Displays sunday as the first day of the week.
-m Displays Monday as the first day of the week.
-j Displays Julian dates (days one-based, numbered from January 1).
-y Displays a calendar for the current year.

Example:

To use this command, open a Terminal window and type the cal command:

By default, the command displays a calendar for the current month.

To display calendar for year 2010

To display calendar of the month Feburary 2010

If you wish to learn more how to use cal command, just type ‘man cal‘ for more details

cal COMMAND:
cal command is used to display the calendar.

SYNTAX:
The Syntax is
cal [options] [month] [year]

OPTIONS:

-1 Displays single month as output.
-3 Displays prev/current/next month output.
-s Displays sunday as the first day of the week.
-m Displays Monday as the first day of the week.
-j Displays Julian dates (days one-based, numbered from January 1).
-y Displays a calendar for the current year.
Share

Leave a Reply

BlogCatalog