Calendaring with cal

One of the handiest UNIX utilities is cal, which—logically—is a calendar. Find out what today's date is, what day of the week December 31st is, or what the calendar year looks like. As Code Listing 15.1 shows, all you have to do is type cal and any specific options you want.

To use the calendar utility:

1.
cal
Type cal at the shell prompt to see the current month's calendar, as shown in Code Listing 15.1. Then, start playing with options, as shown in the next few steps.
2.
cal -j
Use cal -j to see the Julian calendar, which shows each day numbered from the beginning of the year.
3.
cal 1999 | more
Pipe cal 1999 to more to see the whole year's calendar.
4.
cal 12 1941
Type cal plus specific dates to view dates for a particular ...

Get Unix: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.