Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am new to linux. Can anyone help me in changing the time and date which is in CST. I am using RHEL5 linux. I have only CLI. No UI.

share|improve this question
3  
Change time in what? – Bonsi Scott Feb 5 at 17:19
What version of Linux are we talking here? Most desktops have a clock in the upper right corner. Right clicking on that icon will get you to a dialog window where the time, date, and time zone can be changed. – slm Feb 5 at 17:46

closed as not a real question by jasonwryan, Renan, rahmu, warl0ck, Shadur Feb 6 at 6:04

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

1 Answer

To check your local time zone:

# cat /etc/timezone

It should return something that indicates what the current zone is. If it's not correct, you can set it to Central with:

# echo US/Central | sudo tee /etc/timezone
# sudo ln -sf /usr/share/zoneinfo/US/Central /etc/localtime

Once that's set, you can use

# ntpdate 0.pool.ntp.org

(Note: if you receive an error 'the NTP socket is in use' you will need to stop your ntp service and run the program again.)

And to keep your date correct, install the ntp service (if it's not already installed.

share|improve this answer
Thanks for the update, Gilles – Stephan Feb 5 at 23:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.