Use the date command to print the current date and time. If you add the -u flag, the results will be for the Greenwich mean time zone. And if you log in as a superuser, you can even change the date or time with the -s flag. Now, that's power!
Here are some examples:
date Print the date and time.
Sat Nov 2 20:09:43 EST 1996
date -u Print the GMT date and time.
Sun Nov 3 01:09:45 GMT 1996
date -s 0503 Set the clock to 5:03 A.M.
For more information on the date command, see the date manual.
Previous Lesson: Who is Logged In?
Next Lesson: The Echo Command
|
![]() |
|
| <Send This Link to a Friend> <Help> <Bookmark This Page> | ||