Linux how to use the cal command to view the calendar

  

Usually Linux desktop has its own calendar, view date is very convenient, then how to use the command to view the calendar? The following small series will introduce you to Linux how to use the cal command to view the calendar, let's learn together.

The cal command can be used to display the Gregorian calendar. The Gregorian calendar is now the internationally accepted calendar, also known as the Gregorian calendar, which is commonly known as the Gregorian calendar. "The solar calendar" is also known as "the solar calendar", which is based on the earth's orbit around the sun for one year, which is common to all countries in the West, hence the name "Western calendar".

1. Command format:

cal [parameter][month][year]

2. Command function:

Used to view time information such as calendar. If there is only one parameter, it means year (1-9999). If there are two parameters, it means month and year

3. Command Parameters:

-1 Display one month's calendar

-3 Display the system's previous month, current month, next month's calendar

-s Display Sunday is one On the first day of the week, the default format

-m shows Monday as the first day of the week

-j shows the day of the year (the year of the year is calculated by day) , from January 1st, the default number of days in the current month is displayed.

-y Displays the calendar of the current year

4. Example:

Instance 1: Display the current month calendar

Command: cal

Output:

The code is as follows:

[root @localhost ~]# cal

December 2012

Day 1 2 3 5 5

1

2 3 4 5 6 7 8< Br>

9 10 11 12 13 14 15

16 17 18 19 20 21 22

23 24 25 26 27 28 29

30 31

[root@localhost ~]#

Instance 2: Display calendar for the specified month

Command: cal 9 2012

Output:

The code is as follows :

[root@localhost ~]# cal 9 2012

September 2012

Day One Two Three Four Five Six

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

Example 3: Displaying the 2013 Calendar

Command:

The code is as follows:

cal -y 2013

cal 201 3
Previous12Next Total 2 Pages

Copyright © Windows knowledge All Rights Reserved