Open In App

ncal Command in Linux with Examples

Improve
Improve
Like Article
Like
Save
Share
Report

ncal is a command-line tool to view a calendar on the terminal in Linux. It is similar to the cal command in Linux. The major difference between both the commands is the output they display. It shows the current month calendar of the current year with the date highlighted. But with command options, you could even change the month and year. 

 

Working with ncal Command

1. To view calendar. 

 

ncal

 

1ncal

This command will display a vertical calendar in the terminal. 

2. To remove the highlighting from the current date. 

 

ncat -h

 

2-To-remove-the-highlighting-from-the-current-date

This command will not highlight the current date in the output. 

3. To display calendar of a specific month of the current year. 

 

ncal -m3

 

3-To-display-calendar-of-a-specific-month-of-the-current-year

This command will display the calendar for the month of March of this year which is 2020. 

4. To display calendar of a specific year 

 

ncal -y 2016

 

4-To-display-calendar-of-a-specific-year

This command will display the calendar for the year 2016. 

5. To display preceding and upcoming month. 

 

ncal -3

 

5-To-display-preeceding-and-upcoming-month

This command will print the current month calendar along with the calendar of the previous and upcoming months. 

6. To print week number below every week. 

 

ncal -w

 

6-To-print-week-number-below-every-week

This command will print the week number below every week. 

7. To print specific months before the current month. 

 

ncal -B2

 

7-To-print-specific-months-before-the-current-month

This command will display 2 months preceding the current month. 

8. To print specific month after the current month. 

 

ncal -A2

 

8-To-print-specific-month-after-the-current-month

This command will display 2 upcoming months from the current month. 

9. To display calendar in horizontal mode. 

 

ncal -C

 

9-To-display-calendar-in-horizontal-mode

This command will display the calendar in the horizontal mode or in the way cal command displays it. 

10. To print a specific month of a specific year. 

 

ncal -d 2015-04

 

10-To-print-a-specific-month-of-a-specific-year

This command will print the April month of the 2015 year.
 


Last Updated : 26 Oct, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads