Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Cal (command)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{lowercase title}} {{Infobox software | name = cal | logo = | screenshot = Cal screenshot.png | screenshot size = | caption = The <code>cal</code> command as shown in a [[Linux]] [[Z shell|zsh]] session in [[Arch Linux]] | developer = Charles Dye | released = {{Start date and age|1971|11|3}} | latest release version = | latest release date = | programming language = Plan 9: [[C (programming language)|C]]<br />FreeDOS: [[x86 assembly language]] | operating system = [[Unix]], [[Unix-like]], [[Plan 9 from Bell Labs|Plan 9]], [[Inferno (operating system)|Inferno]], [[MSX-DOS]], [[FreeDOS]] | platform = [[Cross-platform]] | genre = [[Command (computing)|Command]] | license = [[util-linux]]: [[BSD-4-Clause]]<br />FreeDOS: [[Freeware]] / [[Source-available software]]<br />Plan 9: [[MIT License]] | website = }} '''{{code|cal}}'''<!-- do not subst template: <code> tag breaks popups --> is a [[command-line interface|command-line]] utility on a number of computer [[operating system]]s including [[Unix]], [[Plan 9 from Bell Labs|Plan 9]], [[Inferno (operating system)|Inferno]] and [[Unix-like]] operating systems such as [[Linux]] that prints an [[ASCII]] calendar of the given month or year. If the user does not specify any [[command-line option]]s, <code>cal</code> will print a calendar of the current month. The command is a standard program on Unix and specified in the [[Single UNIX Specification]]. ==Implementations== The <code>cal</code> command was present in [[Research Unix|1st Edition Unix]]. A <code>cal</code> command is also part of [[ASCII Corporation|ASCII]]'s ''MSX-DOS2 Tools'' for [[MSX-DOS]] version 2.<ref>{{Cite web|url=https://archive.org/details/MSXDOS2TOOLS|title=MSX-DOS2 Tools User's Manual - MSX-DOS2 TOOLS γ¦γΌγΆγΌγΊγγγ₯γ’γ«|date=April 1, 1993|via=Internet Archive}}</ref> It is also available for [[FreeDOS]]. This implementation only supports the Gregorian calendar (New Style) and may be distributed freely, with or without source. The FreeDOS version was developed by Charles Dye.<ref>{{Cite web|url=https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/cal.html|title=ibiblio.org FreeDOS Package -- cal (Unix-like)|website=www.ibiblio.org}}</ref> ==Examples== <syntaxhighlight lang="console"> $ cal February 2024 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 </syntaxhighlight> <syntaxhighlight lang="console"> $ cal -3 (shows the previous, current and next month) June 2022 July 2022 August 2022 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 1 2 1 2 3 4 5 6 5 6 7 8 9 10 11 3 4 5 6 7 8 9 7 8 9 10 11 12 13 12 13 14 15 16 17 18 10 11 12 13 14 15 16 14 15 16 17 18 19 20 19 20 21 22 23 24 25 17 18 19 20 21 22 23 21 22 23 24 25 26 27 26 27 28 29 30 24 25 26 27 28 29 30 28 29 30 31 </syntaxhighlight> <syntaxhighlight lang="console"> $ cal 2023 2023 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 3 4 5 6 7 1 2 3 4 1 2 3 4 8 9 10 11 12 13 14 5 6 7 8 9 10 11 5 6 7 8 9 10 11 15 16 17 18 19 20 21 12 13 14 15 16 17 18 12 13 14 15 16 17 18 22 23 24 25 26 27 28 19 20 21 22 23 24 25 19 20 21 22 23 24 25 29 30 31 26 27 28 26 27 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 1 2 3 4 5 6 1 2 3 2 3 4 5 6 7 8 7 8 9 10 11 12 13 4 5 6 7 8 9 10 9 10 11 12 13 14 15 14 15 16 17 18 19 20 11 12 13 14 15 16 17 16 17 18 19 20 21 22 21 22 23 24 25 26 27 18 19 20 21 22 23 24 23 24 25 26 27 28 29 28 29 30 31 25 26 27 28 29 30 30 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 1 2 3 4 5 1 2 2 3 4 5 6 7 8 6 7 8 9 10 11 12 3 4 5 6 7 8 9 9 10 11 12 13 14 15 13 14 15 16 17 18 19 10 11 12 13 14 15 16 16 17 18 19 20 21 22 20 21 22 23 24 25 26 17 18 19 20 21 22 23 23 24 25 26 27 28 29 27 28 29 30 31 24 25 26 27 28 29 30 30 31 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 3 4 5 6 7 1 2 3 4 1 2 8 9 10 11 12 13 14 5 6 7 8 9 10 11 3 4 5 6 7 8 9 15 16 17 18 19 20 21 12 13 14 15 16 17 18 10 11 12 13 14 15 16 22 23 24 25 26 27 28 19 20 21 22 23 24 25 17 18 19 20 21 22 23 29 30 31 26 27 28 29 30 24 25 26 27 28 29 30 31 </syntaxhighlight> <syntaxhighlight lang="console"> $ cal 6 2023 June 2023 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 </syntaxhighlight> ==Quirks (1752)== {{more|Calendar (New Style) Act 1750}} <syntaxhighlight lang="console"> $ 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 </syntaxhighlight> The [[Gregorian calendar|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."<ref>{{Cite web|url=https://docs.oracle.com/cd/E26502_01/html/E29030/cal-1.html#scrolltoc|title=Synopsis - man pages section 1: User Commands|website=docs.oracle.com}}</ref> The [[Plan 9 from Bell Labs]] manual states: "Try {{mono|cal sep 1752}}." Date of adoption of the reform [[Adoption of the Gregorian calendar|differs widely between countries]] so, for some users, this feature may be a bug. Special handling of 1752 is known to have appeared as early as the first edition of the ''Unix Programmer's Manual'' in 1971.<ref>{{Cite book |last=Thompson |first=K. |url=http://squoze.net/UNIX/v1man/man6/cal |title=Unix Programmer's Manual |last2=Ritchie |first2=D. M. |publisher=Bell Telephone Laboratories |year=1971 |edition=First |pages=cal (VI)}}</ref> ==See also== * [[Cron]] β process for scheduling jobs to run on a particular date * [[List of Unix commands]] ==References== {{Reflist}} {{Refbegin}} * {{man|cu|cal|SUS|print a calendar}} {{Refend}} == Sources == * {{cite book |last1=Ray |first1=Deborah S. |last2=Ray |first2=Eric J. |date=2010 |editor-last=Gulick|editor-first=Rebecca |title=Unix and Linux: Visual QuickStart Guide |publisher=Book Publishers |pages=276β278 |chapter=Calendaring with cal|chapter-url=https://books.google.com/books?id=M-z1SWdCKkwC&dq=cal+linux&pg=PA276 |isbn= 9780132104470|name-list-style=}} ==External links== {{Wikibooks|Guide to Unix|Commands}} * {{man|1|cal|Plan 9}} * {{man|1|cal|Inferno}} * {{man|1|cal|die.net}} * {{man|1|cal|FreeBSD}} * {{man|1|cal|NetBSD}} * {{man|1|cal|OpenBSD}} * [https://web.archive.org/web/20160221144829/http://www.csd.uwo.ca/staff/magi/personal/humour/Computer_Audience/'cal%209%201752'%20explained.html Source of explanation of cal 9 1752 phenomena] (humor) {{Unix commands}} {{Plan 9 commands}} {{Calendaring software}} [[Category:Calendaring software]] [[Category:Standard Unix programs|Cal]] [[Category:Unix SUS2008 utilities]] [[Category:Plan 9 commands]] [[Category:Inferno (operating system) commands]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Calendaring software
(
edit
)
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Code
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Lowercase title
(
edit
)
Template:Main other
(
edit
)
Template:Man
(
edit
)
Template:Mono
(
edit
)
Template:More
(
edit
)
Template:Plan 9 commands
(
edit
)
Template:Refbegin
(
edit
)
Template:Refend
(
edit
)
Template:Reflist
(
edit
)
Template:Sister project
(
edit
)
Template:Template other
(
edit
)
Template:Unix commands
(
edit
)
Template:Wikibooks
(
edit
)