Is there a command to display a Calendar in the terminal?

Solution 1:

cal calendar command for terminal

You can use the cal command to display a calendar in Julian or Gregorian format. The format depends on your locale settings but can be toggled with parameters.

As the screen below shows the default calendar is the current month. You can use the parameter -A 2 to display the next two months or 2018 to display all months in that year:

cal

Solution 2:

An alternative is ncal - this displays the calendar in a vertical format, i.e.:

    March 2017
Su     5 12 19 26
Mo     6 13 20 27
Tu     7 14 21 28
We  1  8 15 22 29
Th  2  9 16 23 30
Fr  3 10 17 24 31
Sa  4 11 18 25

This is slightly harder to read, but supposedly has the advantage that the full year's calendar, by putting four months in each row, fits in a standard sized terminal. In fact, it does not, you have to remove blank lines from the output for it to fit in 24 lines: ncal 2017 | grep -v '^$'. The original version of ncal did not have these blank lines. In any case, it takes less vertical space than the traditional calendar output - 26×76, vs 35×66 for cal.

Solution 3:

Khal is a calendar application that's much more along the lines of what someone might expect in the year 2020:

khal.png

It can be installed via pip3 install khal (or just pip instead of pip3). It supports a standard CalDav format and can by synced to a CalDav server. Additionally it includes an interactive tool (ikhal or khal interactive) (sort of like tig for git) for viewing and editing events in an easier way without having to remember all the flags and syntax and everything.

Solution 4:

Another alternative to the standard cal is an enhanced cal by Alex Matulich. It offers user-configurable colors and the ability to display reminders and appointments next to the calendar.

Enhanced cal page on Unicorn Research site