Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the cal command in Linux

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

The editor will share with you how to use the cal command in Linux. I hope you will get something after reading this article. Let's discuss it together.

The cal command is used to display the current calendar, or the calendar for a specified date, or the current month if no parameters are specified.

Cal displays the current calendar or calendar for a specified date

Note that a single parameter specifies the year to be displayed (1-9999); note that the year must be fully specified: cal 89 does not display the 1989 calendar. The two parameters represent the month (1-12) and the year. If no parameters are specified, the calendar for the current month is displayed.

The year begins with Jan 1 (January 1).

The Gregorian Calendar Reform (Gregorian Reformation) is believed to have taken place on September 3, 1752. Before that, most countries had endorsed the reform (though some did not do so until the early 20 th century). The 10 days after that day were omitted in this reform, so that month's calendar is a little unusual.

Syntax cal [- mjy] [month] [year] option-l # shows monthly output;-3 # shows calendar approaching three months;-s # shows Sunday as the first day of the month;-m # shows Monday as the first day of the week. (default is Sunday.)-j # shows the (Julian) date of the Julian calendar (the number of days based on 1, counting from January 1). -y # displays the calendar for the current year.. Parameter month: specified month; year: specified year. When the instance executes the cal command alone, the calendar is printed out:

[root@localhost] # cal December 2013 one, two, three, four, six, 12, 345, 6, 7, 9, 10, 11, 13, 14, 15, 17, 19, 20, 21, 23, 24, 26, 27, 28, 29, 31, [root@localhost] # cal-j, December 2013, one, two, three, four, five, six, 336, 336, 338, 339, 340, 341, 343, 344, 346, 346, 348, 349, 350, 351. 352 353 354 355 356 357 358 359 360 361 362 363 364 365 [root@localhost] # cal-3 November 2013 December 2013 January 2014 one two three four five six 1 2 1 2 3 4 56 7 1 2 3 4 3 4 5 6 7 8 9 9 9 10 11 12 13 14 5 6 7 9 9 10 11 10 11 12 13 14 15 16 16 17 18 18 20 21 12 13 14 15 16 17 18 18 18 21 22 23 24 25 27 28 19 21 22 23 24 25 26 27 28 19 21 22 23 24 25 26 27 28 19 21 22 23 24 25 26 27 28 30 30 31 27 28 29 30 31 27 28 29 30 31 I believe you have a certain understanding of "how to use the cal command in Linux". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report