Syntax :
cal [[month] year]
Exercise : #( Display Current month ) cal #( Current year, pipe to less to make viewing easier. ) cal 2007 | less #( cal finds months by number, display April of 1983 ) cal 4 1983 #( try your birth-date and year ) |
Exercise: #( Print current local date and time. ) date #( Print the current day of the year and hour as numeric values. ) date "+%j%H" #( Print date in mm/dd/yyyy form. ) date "+%D" #( print Greenwich or UTC time. ) date -u |
Note that the format string is quoted and the + must start the format string.
time generates three times, the real time between start and end of program execution, the system time which is CPU time used for kernel support, such as writing to screen or file i/o, and user CPU time, which is the time running the command's instructions.
Older versions of time have been outpaced by the CPU speed and often return zero for most values. Newer systems have corrected this. On our Linux system, time returns minutes, seconds and 1000ths of seconds.
#( Run time on the top command. Let top run for 2 or 3 refreshes before quitting. ) time top |