"Go" one Linux command per day: Cal command

Source: Internet
Author: User

Original URL: http://www.cnblogs.com/peida/archive/2012/12/14/2817473.html

The CAL command can be used to display a Gregorian calendar. The Gregorian calendar is now the International Universal Calendar, also known as Griel, the Gregorian calendar. "Solar" is also known as "solar Calendar", the earth around the sun for one year, for the western countries are universal, it is also known as "Western Calendar".

1. Command format:

Cal [parameters] [month] [year]

2. Command function:

Used to view time information such as a calendar, such as a single argument, that represents the year (1-9999), and if there are two parameters, the month and year

3. Command parameters:

-1 shows the one month calendar

-3 Display system first one months, current month, next one month calendar

-S displays Sunday for the first day of one weeks, the default format

-M displays Monday for the first day of one weeks
-J Displays the day of the Year in the year (the date of the month is counted, from January 1, and the number of days in the year is displayed by default)
-y Displays the calendar for the current year

4. Usage examples:

Example 1: Display the current month calendar

Command:

Aa.

Output:

[[email protected] ~]# cal

December on 2012

Day 123456

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

31[[email protected] ~]#

Example 2: Display a calendar for a specified month

Command:

Cal 9 2012

Output:

[[email protected] ~]# Cal 9 2012

September on 2012

Day 123456

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:

Cal-y 2013

Cal 2013

Output:

Example 4: Displays the number of days since January 1

Command:

Cal-j

Output:

[Email protected]t ~]# cal-j

December on 2012

Day 123456

336

337 338 339 340 341 342 343

344 345 346 347 348 349 350

351 352 353 354 355 356 357

358 359 360 361 362 363 364

365 366[[email protected] ~]#

Example 5: Monday shown in the first column

Command:

Cal-m

Output:

[Email protected] ~]# cal-m

December on 2012

123456 days

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

31[[email protected] ~]#

"Go" one Linux command per day: Cal command

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.