ubuntu 指令修改时区 tzselect
修改时区
tzselect 指令只是根据提示一步步选择正确时区,但不能真正修改时区,最后输入提示的指令,然后重启,才能永久修改。
aaron@ubuntu:~$ tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent, ocean, "coord", or "TZ".
) Africa
) Americas
) Antarctica
) Asia
) Atlantic Ocean
) Australia
) Europe
) Indian Ocean
) Pacific Ocean
) coord - I want to use geographical coordinates.
) TZ - I want to specify the time zone using the Posix TZ format.
#?
Please select a country whose clocks agree with yours.
) Afghanistan ) Israel ) Palestine
) Armenia ) Japan ) Philippines
) Azerbaijan ) Jordan ) Qatar
) Bahrain ) Kazakhstan ) Russia
) Bangladesh ) Korea (North) ) Saudi Arabia
) Bhutan ) Korea (South) ) Singapore
) Brunei ) Kuwait ) Sri Lanka
) Cambodia ) Kyrgyzstan ) Syria
) China ) Laos ) Taiwan
) Cyprus ) Lebanon ) Tajikistan
) East Timor ) Macau ) Thailand
) Georgia ) Malaysia ) Turkmenistan
) Hong Kong ) Mongolia ) United Arab Emirates
) India ) Myanmar (Burma) ) Uzbekistan
) Indonesia ) Nepal ) Vietnam
) Iran ) Oman ) Yemen
) Iraq ) Pakistan
#?
Please select one of the following time zone regions.
) Beijing Time
) Xinjiang Time
#? The following information has been given: China
Beijing Time Therefore TZ='Asia/Shanghai' will be used.
Local time is now: Thu May :: CST .
Universal Time is now: Thu May :: UTC .
Is the above information OK?
) Yes
) No
#? You can make this change permanent for yourself by appending the line
TZ='Asia/Shanghai'; export TZ
to the file '.profile' in your home directory; then log out and log in again. Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Shanghai
// 此时时区还没有修改成功
// 根据提示输入 TZ='Asia/Shanghai'; export TZ 但重启后又失效
aaron@ubuntu:~$ date
Wed May :: PDT
aaron@ubuntu:~$ sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[sudo] password for aaron:
// 更新时间时,提示没有安装 ntpdate
aaron@ubuntu:~$ sudo ntpdate time.windows.com
sudo: ntpdate: command not found
// 安装
aaron@ubuntu:~$ sudo apt-get install ntpdate
// 更新时间
aaron@ubuntu:~$ sudo ntpdate time.windows.com
May :: ntpdate[]: adjust time server 51.140.127.197 offset 0.044998 sec
aaron@ubuntu:~$ date
Thu May :: CST
// 重启
aaron@ubuntu:~$ sudo reboot
// 时区设置成功
aaron@ubuntu:~$ date
Thu May :: CST
ubuntu 指令修改时区 tzselect的更多相关文章
- ubuntu设置时区为美国中部时间西六区
查看当前ubuntu系统时区 date -R Fri, Dec :: + 显示的是东八区时间及北京时间 然后输入tzselect 按照提示修改对应时区 本例子修改为美国中部时间 西六区 ~$ tzse ...
- 修改ubuntu系统时区
ubuntu默认时区是Etc/UTC,和我们的北京时间相差8个时区,需要修改系统的时区,以下有两种简单方式修改系统时区: 1.修改/etc/timezone文件 vi /etc/timezone 把E ...
- Ubuntu修改时区和时间
1.查看当前时区 date -R 返回显示是 +0000 2.修改时区 tzselect 然后提示选择时区,按顺序选4.9.1,然后确认选1 3.更新本地时区 sudo cp /usr/share/z ...
- [Linux]Ubuntu设置时区和更新时间
Ubuntu 下执行 date -R 查看现在时区 执行 tzselect查看时区,注意这个命令只能查询不能真正的修改时区 执行下面命令,复制文件到 /etc/可修改时区 sudo cp /usr/s ...
- ubuntu系统调整时区和时间
date: 2019-05-30 10:14:23 author:headsen chen 个人原创博客,转录需要注明作者和出处. 1,安装ntpdate,同步标准时间 root@hk-confl ...
- Ubuntu修改时区和更新时间
先查看当前系统时间 root@ubuntu:/# date -R 结果时区是:-0500 我需要的是东八区,这儿显示不是,所以需要设置一个时区 1.运行tzselect root@ubuntu:/# ...
- Ubuntu 修改时区和时间
tzselect #根据提示选择时区 sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #把设置好的时区文件粘贴到 /etc/local ...
- ubuntu修改时区和时间的方法
改时区参考 http://blog.sina.com.cn/s/blog_6c9d65a1010145st.html 1.首先查看时区: swfsadmin@swfsubuntu:~$ date -R ...
- vps国外节点ubuntu修改时区重启不失效
使用了tzselect方法,但是重启后时区又恢复到初始情况了,不得行. 使用下面的方法成功了: 1.将时区修改成上海时区 cp /usr/share/zoneinfo/Asia/Shanghai /e ...
随机推荐
- rsa加解密密钥生成命令
(1)生成原始RSA私钥文件 rsa_private_key.pem(原始私钥) openssl genrsa -out rsa_private_key.pem 2048 (2)将原始RSA私钥转换为 ...
- Dir命令
注: 此系列为自己之前所搭建网站内容. 其实python的os模块能够很好的完成此任务.改天总结下. 之前在处理气象数据时,十几个文件,文件名比较长,需要自己处理变动的年份找出地址的规律再进行文件的读 ...
- NPOI:操作总结
1.套路 使用了NPOI一段时间,也慢慢了解了操作的流程,或者说套路: a.创建Workbook: HSSFWorkbook Workbook = new HSSFWorkbook(); b.在Wor ...
- cf 915
t1:2分钟ac,简单模拟 t2:3发wa,最后再10分钟的时候过了 但是最后被hack了 t3:2发wa,最后还是被hack了 t4:拓扑排序 然后将一个点入度减一 然后是否能拓扑 t5:离散化+线 ...
- Solr后台管理界面配置
配置来源 https://stackoverflow.com/questions/28043957/how-to-set-apache-solr-admin-password 注意:配置用户名密码后 ...
- 第6课:datetime模块、操作数据库、__name__、redis、mock接口
1. datetime模块 import datetime print(datetime.datetime.today()) # 当前时间 2018-01-23 17:22:35.739667 pr ...
- 用JAMES实现自己的邮件服务器
简介 James 是一个企业级的邮件服务器,它完全实现了smtp 和 pops 以及nntp 协议.同时,james服务器又是一个邮件应用程序平台.James的核心是Mailet API,而james ...
- asp页面快速找到菜单按钮转向的页面的方法
asp页面快速找到菜单按钮转向的页面的方法: 鼠标放在按钮上,右键属性即可查看
- windows 10 安装 sql 2005 安装失败
windows 10 安装 sql 2005 安装失败 网上的方法记录: 安装中无法启动需要先用sp4的补丁文件sqlos.dll,sqlservr.exe 替换D:\Program Files (x ...
- phpcms v9取消验证码
phpcms/modules/admin/index.php// $code = isset($_POST['code']) && trim($_POST['code']) ? tri ...