Changing The Time Zone In Linux (Command Line)
Share on facebook
Share on twitter
Share on linkedin

Changing The Time Zone In Linux (Command Line)

Anthony James
Anthony James

There are several different ways to manage time in Linux. This quick tip will show you how to quickly change the local time to the correct time zone for the server. In this Linux tip I’ll show you how to change the localtime to your (or a) current time zone.Location of the local time fileLinux looks at /etc/localtime to determine the current time of your machine. This can either be a symbolic link to the correct time zone or a direct copy of the time zone file.Timezone files are located in /usr/share/zoninfo/For this tip we will assume your server is located in America and will be under the Chicago CST zone.I change the Linux time zone by copying or making a symbolic link to from /usr/share/zoneinfo/America/Chicago to /etc/localtimeTwo methods to do this

cp /usr/share/zoneinfo/America/Chicago /etc/localtime

 

ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime

Type w to change the new time and you’re done!

Recommended

Get more insights, news, and assorted awesomeness around all things cloud learning.

Get Started
Who’s going to be learning?
Sign In
Welcome Back!
Thanks for reaching out!

You’ll hear from us shortly. In the meantime, why not check out what our customers have to say about ACG?

How many seats do you need?

  • $499 USD per seat per year
  • Billed Annually
  • Renews in 12 months

Ready to accelerate learning?

For over 25 licenses, a member of our sales team will walk you through a custom tailored solution for your business.


$2,495.00

Checkout