cal command in linux with flags | Pro Tech guides

cal command in linux with flags

cal command in linux allows you to display a calendar in the terminal. There are many flags you can use with the cal command to get the desired output

cal command in linux with flags | Examples

cal command in linux
cal command in linux

Hello, guys Today I'm going to show how you can use "cal command" in Linux.

"cal" command can be used to display a conventionally formatted calendar on your command line.

Let's see how you can use the "cal" command,

cal command

cal command in linux
cal command

$cal

So to use the "cal" command you can just use "cal" and then press ENTER. It's going to show you the calendar kind of output.

This "cal" command is going to show you the current month. date and the year.

Flags

There are some flags that you can use with this "cal" command. They are,

To show months of Year

cal command in linux with year flag
cal command with a year flag

$cal year

The first flag which you can use with the "cal" command is the year. So whatever here you want to see you can just enter the year number.

For example, I want to see "2020" and then press ENTER. It's going to show all the months in the 2020 year in formatted form.


To print a specific month

cal command to print specific month
To print a specific month

$cal [month] [year]

If you want to view a particular month in a particular year. Then you have to use this flag with the "cal" command.

For example, I want to see the "February of 2020". So I just write "cal 2 2020"  and press ENTER.

It's just going to show that month which you have entered here not the whole calendar.

To display previous and next months

cal command to print months
To show previous, current and next month

$cal -3
If you want to see the previous and next month you can use "cal -3" and press ENTER.

It's going to give you the current, previous and the next month.

Note:

When you give "cal" command by default this number is "-1".

HAVE A NICE DAY💝

see also,
Name

Apps,3,Games,1,Linux,38,Linux Commands,37,Network-Devices,1,Networking,1,Terminal Apps,2,Termux,17,Userland,3,Windows,1,
ltr
item
Pro Tech guides: cal command in linux with flags
cal command in linux with flags
cal command in linux allows you to display a calendar in the terminal. There are many flags you can use with the cal command to get the desired output
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW7ojDxUhv3xVS6vBMRFz7zaHuMFsPtELep73HpQDJMJevhrrDK4HLeOH674XLHs2UDVV9n6SNo9rum663ZQx_1Wi_Hpm2wMqcUH5qHnzg7bfd1uE2vXakEm2ukQcgPx1t_oVMGxf3D9w/s16000/cal-linux-command.png
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW7ojDxUhv3xVS6vBMRFz7zaHuMFsPtELep73HpQDJMJevhrrDK4HLeOH674XLHs2UDVV9n6SNo9rum663ZQx_1Wi_Hpm2wMqcUH5qHnzg7bfd1uE2vXakEm2ukQcgPx1t_oVMGxf3D9w/s72-c/cal-linux-command.png
Pro Tech guides
https://devops-digest.blogspot.com/2021/03/cal-command-in-linux-with-flags.html
https://devops-digest.blogspot.com/
https://devops-digest.blogspot.com/
https://devops-digest.blogspot.com/2021/03/cal-command-in-linux-with-flags.html
true
7053638852026728047
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content