Use of Linux cal command

Use of Linux cal command

1. Command Introduction

The cal (calendar) command is used to display the Gregorian calendar for the current or specified date.

2. Command format

cal [OPTIONS] [[[DAY] MONTH] YEAR]

You can specify YEAR (1-9999), MONTH (1-12), and DAY (1-31). Executing cal alone without any options or parameters displays the calendar for the current month.

3. Option Description

-1, --one
	Show only the current month (default)
-3, --three
	Display the monthly calendar for the previous month, current month, and next month -h, --help
	Display this help message and exit -j, --julian
	Display the date in the year on the first day of the month -m, --monday
	Display Monday as the first day of the week -s, --sunday
	Display Sunday as the first day of the week (default)
-V, --version
	Show version information and exit -y, --year
	Display the calendar for the current year

4. Common Examples

(1) Display the current month.

cal 


(2) Displays the current month, with Monday as the first day of the week.

cal -m 


(3) Display the current month and the day of the year.

cal -j 


(4) A monthly calendar showing the previous month, current month, and next month.

cal-3 


(5) Display the specified date.

cal 24 6 2015 

References

[1] cal(1) manual

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Perfect Solution for No rc.local File in Linux
  • Build a Scala environment under Linux and write a simple Scala program
  • The difference between the Linux program installation directory /opt and the /usr/local directory
  • How to solve the error when connecting to MySQL in Linux: Access denied for user 'root'@'localhost'(using password: YES)
  • Solution to Interrupted System Call error (EINTR) when semop waits for signal under Linux
  • Multiple solutions for linux mysql forgotten password or Access denied for user ''root''@''localhost''

<<:  sql script function to write postgresql database to implement parsing

>>:  Practice of using Vite2+Vue3 to render Markdown documents

Recommend

Solution to the blank page after vue.js packaged project

I believe that many partners who have just come i...

mysql 5.7.17 winx64.zip installation and configuration method graphic tutorial

Preface: I reinstalled win10 and organized the fi...

How to add abort function to promise in JS

Table of contents Overview Promise Race Method Re...

Summary of Docker configuration container location and tips

Tips for using Docker 1. Clean up all stopped doc...

Vue implements two-way data binding

This article example shares the specific code of ...

Detailed explanation of how to use zabbix to monitor oracle database

1. Overview Zabbix is ​​a very powerful and most ...

MySQL character types are case sensitive

By default, MySQL character types are not case-se...

Vue implements book management case

This article example shares the specific code of ...

How to use Antd's Form component in React to implement form functions

1. Construction components 1. A form must contain...

MySQL 8.0.12 Installation and Usage Tutorial

Recorded the installation and use tutorial of MyS...

Beginners learn some HTML tags (3)

Related articles: Beginners learn some HTML tags ...

Encapsulate the navigation bar component with Vue

Preface: Fully encapsulating a functional module ...

Teach you how to use docker-maven-plugin to automate deployment

1. Introduction to docker-maven-plugin In our con...

nginx+tomcat example of accessing the project through the domain name

I was curious about how to access the project usi...

Network configuration of Host Only+NAT mode under VirtualBox

The network configuration of Host Only+NAT mode u...