My Computer Tips

Home | About | Categories | All Tips & Tutorials

Display a calendar in the terminal

ID: 210

Category: Linux Terminal

Added: 6th of November 2020

Views: 2,713

The calendar is installed by default in Debian, however if you are running Ubuntu or another Ubuntu based distribution you may need to install it by entering the following command

sudo apt-get install ncal


To display a calendar in the terminal enter the following command
cal


Display current month

To display a specific month we use the -m switch followed by the month
cal -m December


Display specific month

To display a calendar for a specific year we use the -y switch followed by the year
cal -y 2020


Display complete year

To add (x) months after the current month we use the -a switch followed by the number of months
cal -A 4


Add 4 months to current month