date-displays the date and time or sets the date

 <  Day Day Up  >  

date ”displays the date and time or sets the date

 [ u ] [ a [  ] sss.fff ] [ yymmddhhmm [ .ss ] ] [+format ] 

Without arguments, the date command displays the date and time. If the command-line argument starts with a plus sign, the rest of the argument is used to format the output. If a percent sign is used, the next character is a formatting character to extract a particular part of the date, such as just the year or weekday. To set the date, the command-line argument is expressed in digits representing the year, month, day, hours, and minutes.

Example A.18.
 1   date +%T 2   date +20%y 3   date "+It is now %m/%d /%y" 

EXPLANATION

  1. Displays the time as 20:25:51 .

  2. Displays 2096 .

  3. Displays It is now 07/25/96 .

 <  Day Day Up  >  


UNIX Shells by Example
UNIX Shells by Example (4th Edition)
ISBN: 013147572X
EAN: 2147483647
Year: 2004
Pages: 454
Authors: Ellie Quigley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net