Cal
Cal
Linux cal and ncal command On Unix-like operating systems, the cal and ncal commands display a formatted calendar in the terminal.
Description
By default, the calendar displayed by cal looks like this:
April 2019
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
The ncal ("new cal") command provides the same functions of cal, but it can display the calendar vertically (with weeks in columns). On systems with ncal installed, cal is typically a symbolic link to ncal. It behaves like the original cal if you use the name cal to run the program.
If no options are specified, cal and ncal display the current month, with the current day highlighted.
Syntax
cal month year -m month -y year -h -3 -1 -A num -B num
-d YYYY-MM -j -N
ncal month year -m month -y year -h -3 -1 -A num -B num
-d YYYY-MM -J -C -e -o -p -w -M -S -b
Options
The following options are available in both cal and ncal:
Option Description
-h Don't highlight today's date.
-m month Specify a month to display. The month specifier can be a full month name (e.g., Februiary), a month abbreviation of at least three letters (e.g., Feb), or a number (e.g., 2). If you specify a number, followed by the letter f or p, the month of the following or previous year, respectively, will be displayed. For instance, -m 2f displays February of next year.
-y year Specify a year to display. For example, -y 1970 displays the entire calendar of the year 1970.
-3 Display last month, this month, and next month.
-1 Display only this month. This is the default.
-A num Display num months occurring after any months already specified. For example, -3 -A 3 displays last month, this month, and four months after this one; and -y 1970 -A 2 displays every month in 1970, and the first two months of 1971.
-B num Display num months occurring before any months already specified. For example, -3 -B 2 displays the previous three months, this month, and next month.
-d YYYY-MM Operate as if the current month is number MM of year YYYY.
Options: cal
The following options are available only in cal:
Option Description
-j Display a Julian calendar, instead of the default Gregorian calendar.
All days are numbered from January 1, rather than from the beginning of the month.
-N Behave as if you ran ncal, using its options and display output.
Options: ncal
The following options are available only in ncal:
Option Description
-J Display a Julian calendar, instead of the default Gregorian calendar. All days are numbered from January 1, rather than from the beginning of the month. If combined with -o, display the date of Orthodox Easter according to the Julian calendar.
-e Display the date of Easter for western calendars. This option exists because Easter is an defining date when calculating traditional calendar dates.
-o Display the date of orthodox Easter.
-p Print country codes and "switching days" for switching from Julian to Gregorian calendars in various countries.
-w Print the number of the week under each week column.
-C Behave as if you ran cal, using its options and display output.
-M Display weeks with Monday as the first day.
-S Display weeks with Sunday as the first day. This is the default.
-b Use the calendar display format of cal.
What is an Operating System? » Computer Shortcut Keys and their Functions » Keyboard Function Keys » Computer Basics - Hardware - Software - Parts
Short Stories for Kids - Moral Stories – English Short Stories for Children - Moral Stories for Kids - Stories for Kids - Funny Story for Kids - Scary Stories for Kids - Really Funny Short Stories - Bedtime Stories
Proverb Stories
Powerful Motivational Quotes for Students » Success Quotes » English Short Stories for Kids
Cabin Crew Jobs & Career Advice » Secretary Job Description » Receptionist Job Description » Top 100 Interview Questions and Answers » How to Prepare for an Interview » How to Write a CV » How to Choose a Career » Computer Shortcut Keys and their Functions
Scholarships in Australia » Scholarships in Austria » Scholarships in Belgium » Scholarships in Canada » Scholarships in Germany » Scholarships in Ireland » Scholarships in Italy » Scholarships in Japan » Scholarships in Korea » Scholarships in Netherlands » Scholarships in Switzerland » Scholarships in UK » Scholarships in USA
Scholarships for Study in Africa » Scholarships for African Students » Undergraduate Scholarships » African Women Scholarships & Grants Scholarships for Study in Africa » Scholarships for African Students » Undergraduate Scholarships » African Women Scholarships & Grants Scholarships for Study in Africa » Scholarships for African Students » Undergraduate Scholarships »
Click here to post comments
Join in and write your own page! It's easy to do. How? Simply click here to return to Computer Basics FAQ.