Most viewed posts
LINUX COMMANDS
Search
date
Linux Command: date
date [options] [+format] [date]
Print the current date and time. You may specify a display format, which can consist of literal text strings (blanks must be quoted) as well as field descriptors, whose values are described in the following entries (the listing shows some logical groupings). A privileged
user can change the system’s date and time.
date 0701040009 Set the date to July 1 (0701), 4 a.m. (0400), 2009 (09)
date +"Hello%t Date is %D %n%t Time is %T" Produces a formatted date as follows: Hello Date is 02/20/09
date --date='TZ="America/Los_Angeles" 09:00 next Fri' What's the local time for 9AM next Friday on west coast US
date --date='@2147483647' Convert seconds since the epoch (1970-01-01 UTC) to date
date --date='25 Dec' +%A What day does xmas fall on, this year
[ $(date -d "tomorrow" +%d) = "01" ] || exit Exit a script unless it's the last day of the month
date -d fri What date is it this friday
Linux Command: cal
cal [options] [[[day] month] year]
Print a 12-month calendar (beginning with January) for the given year, or a one-month calendar of the given month and year. With a
day specified as well, print the calendar for that month and year, with the day highlighted. month ranges from 1 to 12. year ranges
from 1 to 9999. With no arguments, print a calendar for the current month.
cal 9 1752 Display a calendar for a particular month year
cal -3 Display a calendar (with 3 months)