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

Steps to purchase a cloud server and install the Pagoda Panel on Alibaba Cloud

Alibaba Cloud purchases servers Purchase a cloud ...

Three ways to avoid duplicate insertion of data in MySql

Preface In the case of primary key conflict or un...

Detailed explanation of the difference between flex and inline-flex in CSS

inline-flex is the same as inline-block. It is a ...

How to modify mysql to allow remote connections

Regarding the issue of MySQL remote connection, w...

Vue implements a shopping cart that can change the shopping quantity

This article shares with you how to use Vue to ch...

How to use JSX in Vue

What is JSX JSX is a syntax extension of Javascri...

CSS: visited pseudo-class selector secret memories

Yesterday I wanted to use a:visited to change the...

Problems encountered when uploading images using axios in Vue

Table of contents What is FormData? A practical e...

How to build Git service based on http protocol on VMware+centOS 8

Table of contents 1. Cause 2. Equipment Informati...

Detailed explanation of MySQL combined index method

For any DBMS, indexes are the most important fact...

Summary of the unknown usage of "!" in Linux

Preface In fact, the humble "!" has man...

Let’s take a look at JavaScript precompilation (summary)

JS running trilogy js running code is divided int...

Detailed explanation of mysql basic operation statement commands

1. Connect to MySQL Format: mysql -h host address...

Detailed explanation of HTML basics (Part 2)

1. List The list ul container is loaded with a fo...

Vue uses filters to format dates

This article example shares the specific code of ...