Calendaring from the command line
On Schedule
![](/var/linux_magazin/storage/images/issues/2014/169/command-line-calendar-tools/78002306_20.png/639930-1-eng-US/78002306_20.png_medium.png)
We take a spin through several personal calendar apps that you can manage from the command line.
If you have done any administration on a Linux system, you may have used Cron [1] or Anacron [2] for scheduling system commands. What about scheduling personal information from the command line, however? Although you could just about manage to schedule events using Cron or Anacron, free software has several more versatile applications for personal calendaring, most notably Cal or NCal [3], Calendar [4], Remind [5], and When [6].
Most of these applications are in the grand Unix tradition, focusing on a limited set of functions and are configurable in a text editor. Often, the main differences between them is the format for entering events and the syntax for a particular function, although these applications appear to borrow heavily from one another. All of these alternatives are standard in the repositories of most distributions, although only Cal is generally installed by default. Simple and quick, you may find them a welcome change after wrestling with KDE's Akonadi personal information manager or the unresponsiveness in the Google Calendar interface.
Cal and NCal
Cal and NCal provide the command-line equivalent of the date and time applet on a desktop panel that displays calendars but lacks any ability to add personal events. The main difference between Cal and NCal is that Cal organizes each month by columns, and NCal organizes by rows (Figure 1).
By itself, either command displays a calendar for the current month. However, you can display the calendar for an entire year by specifying the year as a four-digit number immediately after the basic command.
Using -A [NUMBER]
or -B[NUMBER]
, you can set the number of months to display before and after the current month. Similarly -3
displays the previous, current, and next month. By default, each week starts on Monday, but you can change the start of the week to Sunday with -S
, or back to Monday with -M
.
Calendar
Calendar looks for files called ~/calendar.[EXTENSION]
. The default calendar it looks for is calendar
, but you can use the -f [FILE]
option to specify another file, such as calendar.birthday
if you are organizing events by files.
Within a calendar file, Calendar looks for lines with the following format:
[DATE] [TAB] [EVENT DESCRIPTION]
The date is expressed in two digits for the day, month, and year, separated by a space, with a day or month assumed to come first. If the calendar file starts with a Language=[LANGUAGE]
field, then the calendar
command looks specifically for date formats that fit that locale's default format. Otherwise, almost any date format can be used, although in the case of confusion, a format is assumed to be MM DD
rather than DD MM
(Figure 2).
![](/var/linux_magazin/storage/images/issues/2014/169/command-line-calendar-tools/figure-2/639936-1-eng-US/Figure-2_large.png)
By default, Calendar reprints all lines for the current and next day. On Fridays, it takes into account the weekend by printing entries from Friday to Monday.
Appointments can also be defined in others ways. For example, an asterisk (*) indicates that an event takes place every month, and a day of the week means that the event occurs whenever that day occurs.
The default display of Calendar can also be modified with options, such as -A [NUMBER]
to change the number of future days that displays and -B [NUMBER]
to change the number of previous days.
Calendar is a serviceable choice, but the expectations of the date format may be a nuisance to those who prefer to start dates with a year.
Remind
Of all the applications mentioned here, Remind has by far the most options and variations. Because it does not include a preference file, many of these options have to be added to the command line.
Remind uses an event file of any name. The format for an event entry is:
REM [DAY] [DATE] +[ADVANCED WARNING] MSG [MESSAGE]
In this format, REM
signals that the line should be included when Remind prints out events, whereas the advanced warning is an optional entry for the number of days before the event that reminders should start.
Dates in an entry are varied. A two-digit year means a year between 1990 and 2075, whereas a month or a day of the week is case insensitive and can be either the full name or the first three letters as an abbreviation. A range of weekdays can be specified, or, if only a date is given, the event is mentioned every month on that date. About halfway down, Remind's man pages give 16 examples that can help you learn how dates are read.
The simplest form of command is:
remind -n [FILENAME]
The option -n
prints events in calendar format (Figure 3). Alternatives include specifying the number of months in the calendar with -c =[NUMBERS]
and displaying all events with -t
.
![](/var/linux_magazin/storage/images/issues/2014/169/command-line-calendar-tools/figure-3/639939-1-eng-US/Figure-3_large.png)
If anything, Remind offers more options than many users want. However, remember Remind if you are having trouble finding the exact behavior you need in a calendar application. Odds are, if any of the applications mentioned here have the options you need, Remind will have them.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.