Linux command cal, calendar

  • Last update: Apr 3, 2024
  • Views: 37
  • Author: Admin
Linux command cal, calendar

Hello colleagues.

In today's article, we will look at such a command in Linux like cal. The cal command is designed to allow you to view the yearly calendar or even narrow it down to a monthly calendar. cal is a great tool that displays a calendar for a specific year or month depending on the passed parameters.

 

Article content:

  1. Cal syntax.
  2. Examples.

 

1. Cal syntax.

cal [-mjy] [[month] year]

  • -m - displays the current month.
  • -j - displays the number of the current day
  • -y - will display all months of the current year.

 

2. Examples.

2.1. Show the current month of the current year.

$. cal

linux_cal

 

2.2. Show all months of the current year.

$. cal -y

linux_cal

 

2.3. Show the last month of calendar in the current year.

$. cal 12 2022

linux_cal


 

Thank you all, I hope my article was of some help to you.

SIMILAR ARTICLES

Linux cp command, copying files
How to clear a file in Linux