Open In App

ncal Command in Linux with Examples

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

 

This command will display a vertical calendar in the terminal. 

2. To remove the highlighting from the current date. 

 

ncat -h

 

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

 

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

 

This command will display the calendar for the year 2016. 

5. To display preceding and upcoming month. 

 

ncal -3

 

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

 

This command will print the week number below every week. 

7. To print specific months before the current month. 

 

ncal -B2

 

This command will display 2 months preceding the current month. 

8. To print specific month after the current month. 

 

ncal -A2

 

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

9. To display calendar in horizontal mode. 

 

ncal -C

 

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

 

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

Article Tags :