Cal (Unix)

cal

The `cal` command as shown in a Linux Bash session in Windows 10

Developer(s)| Charles Dye
Initial release| November 3, 1971; 54 years ago (1971-11-03)
Operating system| Unix, Unix-like, Plan 9, Inferno, MSX-DOS, FreeDOS
Platform| Cross-platform
Type| Command

`cal` is a standard program on Unix and Unix-like operating systems that prints an ASCII calendar of the given month or year. If the user does not specify any command-line options, `cal` will print a calendar of the current month.

## Contents

* 1 Implementations
* 2 Examples
* 3 Quirks (1752)
* 4 See also
* 5 References
* 6 External links

## Implementations

The `cal` command was present in 1st Edition Unix.

A `cal` command is also part of ASCII's MSX-DOS2 Tools for MSX-DOS version 2.[1] It is also available for FreeDOS.[2]

## Examples

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

$ cal -3 (shows the previous, current and next month)
March 2021            April 2021             May 2021
Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa
1  2  3  4  5  6               1  2  3                     1
7  8  9 10 11 12 13   4  5  6  7  8  9 10   2  3  4  5  6  7  8
14 15 16 17 18 19 20  11 12 13 14 15 16 17   9 10 11 12 13 14 15
21 22 23 24 25 26 27  18 19 20 21 22 23 24  16 17 18 19 20 21 22
28 29 30 31           25 26 27 28 29 30     23 24 25 26 27 28 29
30 31

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

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

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

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

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

## Quirks (1752)

Further information: Calendar (New Style) Act 1750

$ cal 9 1752
September 1752
S  M Tu  W Th  F  S
1  2 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

The Gregorian calendar reform was adopted by the Kingdom of Great Britain, including its possessions in North America (later to become eastern USA and Canada), in September 1752. As a result, the September 1752 cal shows the adjusted days missing. This month was the official (British) adoption of the Gregorian calendar from the previously used Julian calendar. This has been documented in the man pages for Sun Solaris as follows. "An unusual calendar is printed for September 1752. That is the month when 11 days were skipped to make up for lack of leap year adjustments."[3] The Plan 9 from Bell Labs manual states: "Try cal sep 1752." Date of adoption of the reform differs widely between countries so, for some users, this feature may be a bug.

## See also

* Cron – process for scheduling jobs to run on a particular date
* List of Unix commands

## References

1. ↑ "MSX-DOS2 Tools User's Manual - MSX-DOS2 TOOLS ユーザーズマニュアル". April 1, 1993. http://archive.org/details/MSXDOS2TOOLS.
2. ↑ "ibiblio.org FreeDOS Package -- cal (Unix-like)". https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/cal.html.
3. ↑ "Synopsis - man pages section 1: User Commands". https://docs.oracle.com/cd/E26502_01/html/E29030/cal-1.html#scrolltoc.

* `cal`: print a calendar – Commands & Utilities Reference, The Single UNIX Specification, Issue 7 from The Open Group

## External links

* `cal(1)` – Plan 9 Programmer's Manual, Volume 1
* `cal(1)` – Inferno General commands Manual
* `cal(1)` – Linux User Commands Manual
* `cal(1)` – FreeBSD General Commands Manual
* `cal(1)` – NetBSD General Commands Manual
* `cal(1)` – OpenBSD General Commands Manual
* Source of explanation of cal 9 1752 phenomena (humor)

* v
* t
* e

Unix command-line interface programs and shell builtins

File system|

* cat
* chmod
* chown
* chgrp
* cksum
* cmp
* cp
* dd
* du
* df
* file
* fuser
* ln
* ls
* mkdir
* mv
* pax
* pwd
* rm
* rmdir
* split
* tee
* touch
* type
* umask

Processes|

* at
* bg
* crontab
* fg
* kill
* nice
* ps
* time

User environment|

* env
* exit
* logname
* mesg
* talk
* tput
* uname
* who
* write

Text processing|

* awk
* basename
* comm
* csplit
* cut
* diff
* dirname
* ed
* ex
* fold
* head
* iconv
* join
* m4
* more
* nl
* paste
* patch
* printf
* sed
* sort
* strings
* tail
* tr
* uniq
* vi
* wc
* xargs

Shell builtins|

* alias
* cd
* echo
* test
* unset
* wait

Searching|

* find
* grep

Documentation|

* man

Software development|

* ar
* ctags
* lex
* make
* nm
* strip
* yacc

Miscellaneous|

* bc
* cal
* expr
* lp
* od
* sleep
* true and false

* Categories
* Standard Unix programs
* Unix SUS2008 utilities
* List

* v
* t
* e

Calendaring software

* 30 Boxes
* Any.do
* Artist Growth
* Cal (Unix)
* Calendar (Apple)
* Calendar (Windows)
* Cozi Central
* DAViCal
* Hiri
* EM Client
* EProductivity
* Evolution
* Google Calendar
* Holiline Reminder
* Ical (Unix)
* Lanyrd
* Mail (Windows)
* Meeting Maker
* Microsoft Outlook
* Desktop
* Mobile
* Web
* Mozilla Calendar Project
* Lightning
* Sunbird
* Rainlendar
* Remember the Milk
* SabreDAV
* Sun Java System Calendar Server
* Oracle Communications Unified Communications Suite
* Upcoming
* Yahoo! Calendar
* Windows Live Mail
* wmCalClock

Discontinued|

* Chandler
* Ecco Pro
* HotJava Views
* Microsoft Entourage
* MobileMe
* Now Up-to-Date
* Plan
* Sunrise Calendar
* Tempo
* Windows Mobile Device Center

0.00

(0 votes)

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Software:Cal_(Unix)&oldid=683888"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template