Gice

Technology and General Blog

In some cases, you could want to have a peek at the year’s calendar or even narrow it down to a month’s calendar. The Linux cal command is an exceptional constructed-in tool that shows a calendar of a offered calendar year or thirty day period relying on the selections handed.

In this brief guidebook, we take a look at a few example sages of the Linux cal command.

Basic syntax

The cal command can take the following command syntax:

Linux cal command with no arguments

In its standard structure, the cal command prints out the recent month and highlights the current working day. For instance, by the time I’m creating this, the date is  18th May perhaps 2021

Print a month of the calendar year with cal command

To print a distinct thirty day period of the calendar year, present the numeric worth of the month  [ 1 – 12 ] followed by the yr.

For example, to screen the 10th thirty day period of 2021, operate the command:

This prints out the calendar dates for the 10th month ( October )  only.

Alternatively, you can invoke the -m  option adopted by the thirty day period of the 12 months. If the year is not delivered as an argument, then the month of the present year is printed in its place.

Print  present month along with earlier & adhering to month

Let’s test out some thing more bold. The cal command also permits you to print the preceding, existing, and the following month. Merely go the -3 alternative at the finish

Print  the entire  calendar of the latest 12 months

To print the whole conventional calendar for the existing calendar year run:

For instance, to watch the calendar of a different yr, for instance, 2022, specify the year after the cal command as demonstrated.

These are some of the normally made use of cal command examples. On the other hand, if curiosity receives the improved of you, find extra command selections by visiting the cal person internet pages as revealed.

Summary

The  Linux cal command shows a uncomplicated calendar that permits you to see the present-day thirty day period of the calendar year, the overall present 12 months, or other months or many years, dependent on your command arguments.

Leave a Reply

Your email address will not be published. Required fields are marked *