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

Use the cal command of linux to display the calendar

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Do not know how to use the cal command linux calendar display? In fact, it is not difficult to solve this problem. Let Xiaobian take you to learn how to solve it together. I hope you will gain a lot after reading this article.

The cal command takes its name from the English word Calendar. Change the command to display the current calendar, or the Gregorian calendar of the specified date (Gregorian calendar is now the international calendar, also known as Gregorian calendar, commonly known as Gregorian calendar). If there is only one parameter, it represents the year (1-9999), and if there are two parameters, it represents the month and year.

Syntax format: cal [parameter] [month] [year]

Common parameters:

-l Single Month Minute Output Calendar-3 Display calendar of last three months-s Set Sunday as first day of month-m Set Monday as first day of month-j Display day of year (Julian Day)-y Display calendar of year

Reference Example

Calendar showing current month:

[root@linuxcool ~]# cal

April 2019

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

Calendar showing the last three months (current month, previous month and next month):

[root@linuxcool ~]# cal -3

March 2019 April 2019 May 2019

Day one, two, three, four, five, six, one, two, three, four, five, six, one, two, three, four, five, six.

1 2 1 2 3 4 5 6 1 2 3 4

3 4 5 6 7 8 9 7 8 9 10 11 12 13 5 6 7 8 9 10 11

10 11 12 13 14 15 16 14 15 16 17 18 19 20 12 13 14 15 16 17 18

17 18 19 20 21 22 23 21 22 23 24 25 26 27 19 20 21 22 23 24 25

24 25 26 27 28 29 30 28 29 30 26 27 28 29 30 31

31

Calendar showing the specified year and month, such as calendar showing February 2020:

[root@linuxcool ~]# cal 2 2020

February 2020

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 Thank you for reading this article carefully, hope Xiaobian share the use of linux cal command display calendar content is helpful to everyone, but also hope that everyone more support, pay attention to industry information channels, encounter problems to find, detailed solutions waiting for you to learn!

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

Servers

Wechat

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

12
Report