How to Display a Calendar in Linux



Linux


In this article, we show how to display a calendar in linux.

So we can show a calendar in the command line of a linux terminal.

And we show a calendar with the keyword, cal

Now there's a few ways we can display a calendar in linux.

If we simply put the word, cal, without anything else, then we'll get the current month.

So if we just put the following keyword below, we get the calendar for the current month we are in.



Running the keyword above gives us the following output shown below.

Showing a calendar in linux

Next, if we want to show the entire calendar for the current year, we specify the following below.



The following code above will show us the full calendar for the current year.

Displaying the calendar for the current year in linux

So you see the full year calendar for the current year.

We can show the calendar for any year in linux. We do this by specifying, cal followed by the year.

The following code below shows us the calendar for the year 1987.



Running this code, we get the following output shown below.

Displaying the calendar for the year 1987 in linux

We can also display just the month for any given month of any year in linux.

We can specify the calendar for whatever month we want to view with the line, cal followed by the month and year of that time.

So with the following code below, we show the calendar for June of 2018.



So with this code, the calendar for June of 2018 will be displayed.

This is shown below.

Displaying the calendar for June 2018 in linux

And this is how we can display a calendar in linux.


Related Resources

How to Randomly Select From or Shuffle a List in Python



HTML Comment Box is loading comments...