The simplest output:
# datewed June 6 : £2018
1. Gets the current time, output in the specified format:
# date +%y-%m-%d standard output date (where: + must be,-optional, can also be output according to the specified style, for example:/,* 2018 -06 -06 Span style= "COLOR: #000000" ># date " +%y-% m-%d%h:%m:%s.%n " display month day minute minutes seconds 2018 -06 -06 16 : 35 : 02.955352720 # date " +%y%m%d%h%m%s%n " can be used as a timestamp 20180606163640400503349
2. Get the time before and after the current date, date with parameter-D, before before, without before:
# date-d'1 days ago'+%y-%m-%D2018- .- to# Date-D'1 Days'+%y-%m-%D2018- .- -# Date-D'1 years ago'+%y-%m-%D .- .- .# Date-D'1 Years'+%y-%m-%D2019- .- .# Date-D'1 months ago'+%y-%m-%D2018- to- .# Date-D'1 months'+%y-%m-%D2018- -- .# Date-D'1 minutes ago' "+%y-%m-%d%h:%m:%s"2018- .- . the: -: -
3. Get the current day of the year, the month of the week, etc.
# date +%J #当年的第N天 157+%w #当周的第N天 3+%d #当月的第N天 .
For more information, please enter: Date--help online Help.
Shell Date Command Get time--rich and colorful