This article is about your system time, specifically how to find your timezone in the terminal. It shouldn’t be a very long article and it should be relatively easy and suitable for new Linux users.
Why would you want to find your timezone in the terminal? Well, for starters you may not have the proper time set and need to verify it. You may also be working with servers scattered across the globe and knowing the timezone may be important.
As you may need things synchronized, knowing the timezone could be important. Seeing as you’re not always able to access a GUI desktop, you might want to find your timezone in the terminal. So, to those end, this article will share a few ways to do so.
Find Your Timezone In The Terminal:
Obviously, this article requires an open terminal. If you don’t know how to open the terminal, you can do so with your keyboard – just press
Anyhow, there are multiple ways to do this. For starters, you can just use the date command. It looks like this:
1 | date |
The output will have your timezone in it. For example, the output of that command on one of my boxes looks like:
1 2 | $ date Fri 08 Oct 2021 08:17:53 PM EDT |
As you can see, the timezone is at the end. In my case, it’s “EDT” and that’s probably the easiest way to get the timezone information.
You can also use ‘timedatectl’ which looks like this:
1 | timedatectl |
That’ll give you the timezone and even tell you the adjustment from GMT. If you want, you can use grep with it.
1 | timedatectl | grep "Time zone" |
That will, of course, just output the line containing your timezone. Also, I have no idea why it’s two words. I know it as one word, but here we are and I suppose it’s just not that important.
I have one more way to find your timezone in the terminal and it’ll output your timezone in text. It’s just:
1 | cat /etc/timezone |
The output from that would look a little like this:
1 2 | $ cat /etc/timezone America/New_York |
So, there are a few ways. There are surely other ways, so feel free to leave a comment sharing them.
Closure:
And there you have it, another article. This one shares how to find your timezone in the terminal. It’s a relatively easy article to follow and not really a tool I expect most users to need. Still, it’s there if you need it and this article stands as a reference to it.
Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.
You forgot this one, try running this on Ubuntu
ls -l /etc/localtime