When working in the terminal it's inconvenient navigating up to the systray to display the current calendar. Is there a command that will display a calendar from the terminal?
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:
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
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.
Although these are GUI calendars you can still call them from the terminal. They allow you to navigate through the months and years. They are designed to be called from your Bash scripts but like all Bash commands you can call them from the terminal too.
YAD (Yet Another Dialog) super-charged fork of
Zenity GUI fork of text-based
Do not be concerned by the Gtk warning message. You see that a lot when running GUI programs from the terminal. eg.
nautilus display similar warnings.