Hello guys I am Dr Hack Virus !
If you like my post so comment in my post and tell me what you need!
I started a Ethical Hacking Course So stay with me
You also Follow me on-
Now i come with the new and interesting topic is Cal Command Cal mean calendar.I will start the calendar command from the beginning, stay with me in this topic. I show you all Calendar command step by step. Let start!
If you want to quickly view a calendar on the terminal in Linux, then cal is the command-line tool that should be use. By default the command displays the current Date & Month in output with highlighting.
We have same command for calendar in Linux Terminal is ncal (New Calendar). The ncal commands provides the same functions of cal command. In ncal command same syntax is different to cal command syntax.
"# cal [ -m [ month ] ] [ -y [ year ] ] [-3] [-1] [-A [Number] ] [-B [Number] ] [-d [yyyy-mm] ]"
"# ncal [ -m [ month ] ] [ -y [ year ] ] [-3] [-1] [-A [Number] ] [-B [Number] ] [-d [yyyy-mm] ] [-p]
[-C] [-e] [-o] [-w] [-M] [-S] [-b]"
The cal utility displays the calendar in the traditional horizontal format. It output show the current month and date.
The ncal(New Calendar) command displays the calendar in the vertical format.
- Turn off the today's date highlight
In default output the current date is highlight in the white box. If we turn off this highlighting we use the -h command.
-h = don't highlighting today's date
command = ncal -h and press enter
*This cal -h command does not work in cal utility.
- Display the Specified Month
The cal/ncal commands displays the current month by default, but we can use the -m[month [numeric value] ] command line option in order to have a specific month displayed. In this command we use the numeric value[1-12] or month name example jan-dec that represent the specified month.
cal/ncal -m[1-12] or cal/ncal -m[jan-dec]
* If you specify a number followed by the letter f or p the month of the following or previous year.
f = Following Year
p = Previous Year
cal/ncal -m [numeric value 1-12]f
cal/ncal -3 [numeric value 1-12]p
We see the complete year calendar using the -y command line option. Use this option in order to view the calendar for specific year example : -y 2019, -y 1980 etc.
cal/ncal 2019 [Specific year]
cal/ncal -y [This command for current year]
cal ncal -y 2019 [This command for specific year]
- Display Previous,Current and Coming Month
If you want to see the last,current and coming month on your screen so pass this command in your terminal -3. This command show you 3 month's calendar.
cal/ncal -3
This is the default use this option to view the calendar of only one month.
- Julian Calendar and Julian days
Display a Julian calendar all days are numbered form January 1, rather then from the beginning of the month. We type the command for Julian days -j and for specific month -m[numeric value or Month name] -j press enter.
cal/ncal -j [current month]
cal/ncal -m -j [Specific month]
- Add a specific number of month before or after the current one in output
A - [After] By using this command we see the current month and also see the after coming month.
B - [Before] By using this command we see the current month and also see the before previews months.
cal/ncal -A[1-1000000000]
cal/ncal -B[1-10000]
cal/ncal -B4 -A3
- Define a particular month and year
If you want see the particular month/year by using the -d[define] command. This option requires a year and month to passed in yyyy-mm format.
cal/ncal -d yyyy-mm [2019-05]
- Date of Easter and Orthodox Easter
Display the date of Easter for western calendar. This option exists because Easter is an defining date when calculating traditional calendar dates.The ncal command to displays the date of orthodox easter(for Greek and Russian orthodox churches). The latter asks ncal to display date of Easter for western churches.
ncal -e [Easter Date]
ncal -o [Orthodox Easter]
To print the week number below each column use the -w[week] command in terminal. The last row displays the number of week.
ncal -w
ncal -m -w
- Change the starting day of the Week
- If you want to starting day is Monday of the week we use the -M[monday] command in Linux Terminal.
- If you want to starting day is Sunday of the week we use the -S[sunday] command in Linux Terminal.
ncal -M [Sunday to Monday]
ncal -S [Monday to Sunday]
- Display Output like cal command
By using this command ncal output comes like cal command [Horizontal Type]. Here we have 2 type commands let see the use !
ncal -C
ncal -b
Comments
Post a Comment