OSY Practical Assignment No.2
OSY Practical Assignment No.2
1. Write down different options for cal commands. (use $man cal)
Ans.
-h : Turns of highlighting of today.
-p : Print the country codes and switching days from Julian to Gregorian
Calendar as they are assumed by ncal. The country code as determined from
the local environment is marked with an asterisk.
-y : Display a calendar for the specified year. This option is implied when a
year but no month are specified on the command line.
-C : Completely switch to cal mode. For cal like output only, use -b instead.
3) Give a single command to display the calendar of pervious, current and next
month.
Ans.
cal -3 command is used to display the calendar of pervious, current and next
month.
4) Give the command to display full week day (eg. Sunday) using date
command.
Ans.
%A is used as Locale‘s abbreviated full weekday name (e.g., Sunday)
EXERCISE :
Ans:
a) $cal 04 2019
b) $date ―+Today‘s information: %D and %B‖;cal
d) $cal -3
e) $cal -5
f) $cal -2000
2) Give the syntax of commands for displaying the output. (use date)
Ans.
a) This is ………. Month of the year ………. (Abbreviation for the month
and 4-digit year)
Ans. date “+This is %b month of the year %Y”
b) This is the ………. th day of this year.
CONCLUSION :
We successfully implemented commands to perform operations using
commands like date, time, cal, clear, banner , tty, script, man.