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?
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 terminalYou 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 or2018
to display all months in that year:Ubuntu versions after 20.04
After version 20.04 you may have to use
Note the
ncal
package does include thecal
command. Also note thatncal
is available out of the box in earlier Ubuntu versions before20.04
as well.For example on Ubuntu 16.04 LTS ECM:
An alternative is ncal - this displays the calendar in a vertical format, i.e.:
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 forcal
.Khal is a calendar application that's much more along the lines of what someone might expect in the year 2020:
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
orkhal interactive
) (sort of liketig
for git) for viewing and editing events in an easier way without having to remember all the flags and syntax and everything.Programmable Calendars
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 ofZenity
Zenity
GUI fork of text-baseddialog
Do not be concerned by the Gtk warning message. You see that a lot when running GUI programs from the terminal. eg.
gedit
andnautilus
display similar warnings.Another alternative to the standard
cal
is anenhanced 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
Edit 2022-06-01: It's available in the repos with
sudo apt install ccal
.use
cal
command for default calendar. also you can installjcal
package for jalali calendar.