9/11/2007

How can I set the system date and time from the command prompt (bash shell)?

Use date command to display the current date and time or set the system date and time over ssh session.
This is useful if the Linux server time and/or date is wrong, and you need to set it to new values from the shell prompt.
Use the following syntax to set new data and time:

date set="STRING"

For example, set new data to 2 Oct 2006 18:00:00, type the following command as root user:

# date -s "2 OCT 2006 18:00:00"
 
 

0 Comments:

Post a Comment

<< Home

Free Web Counter
Free Counter