修改时区

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的更多相关文章

  1. ubuntu设置时区为美国中部时间西六区

    查看当前ubuntu系统时区 date -R Fri, Dec :: + 显示的是东八区时间及北京时间 然后输入tzselect 按照提示修改对应时区 本例子修改为美国中部时间 西六区 ~$ tzse ...

  2. 修改ubuntu系统时区

    ubuntu默认时区是Etc/UTC,和我们的北京时间相差8个时区,需要修改系统的时区,以下有两种简单方式修改系统时区: 1.修改/etc/timezone文件 vi /etc/timezone 把E ...

  3. Ubuntu修改时区和时间

    1.查看当前时区 date -R 返回显示是 +0000 2.修改时区 tzselect 然后提示选择时区,按顺序选4.9.1,然后确认选1 3.更新本地时区 sudo cp /usr/share/z ...

  4. [Linux]Ubuntu设置时区和更新时间

    Ubuntu 下执行 date -R 查看现在时区 执行 tzselect查看时区,注意这个命令只能查询不能真正的修改时区 执行下面命令,复制文件到 /etc/可修改时区 sudo cp /usr/s ...

  5. ubuntu系统调整时区和时间

    date: 2019-05-30  10:14:23 author:headsen  chen 个人原创博客,转录需要注明作者和出处. 1,安装ntpdate,同步标准时间 root@hk-confl ...

  6. Ubuntu修改时区和更新时间

    先查看当前系统时间 root@ubuntu:/# date -R 结果时区是:-0500 我需要的是东八区,这儿显示不是,所以需要设置一个时区 1.运行tzselect root@ubuntu:/# ...

  7. Ubuntu 修改时区和时间

    tzselect #根据提示选择时区 sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime #把设置好的时区文件粘贴到 /etc/local ...

  8. ubuntu修改时区和时间的方法

    改时区参考 http://blog.sina.com.cn/s/blog_6c9d65a1010145st.html 1.首先查看时区: swfsadmin@swfsubuntu:~$ date -R ...

  9. vps国外节点ubuntu修改时区重启不失效

    使用了tzselect方法,但是重启后时区又恢复到初始情况了,不得行. 使用下面的方法成功了: 1.将时区修改成上海时区 cp /usr/share/zoneinfo/Asia/Shanghai /e ...

随机推荐

  1. influxdb和boltDB简介——MVCC+B+树,Go写成,Bolt类似于LMDB,这个被认为是在现代kye/value存储中最好的,influxdb后端存储有LevelDB换成了BoltDB

    influxdb influxdb是最新的一个时间序列数据库,最新一两年才产生,但已经拥有极高的人气.influxdb 是用Go写的,0.9版本的influxdb对于之前会有很大的改变,后端存储有Le ...

  2. EPANET中的typedef使用

    struct  Floatlist  /* Element of list of floats */{   double  value;   struct  Floatlist *next;};typ ...

  3. 缓存LruCache简单创建和使用

    LruCache一般使用: /** * 总容量为当前进程的1/8,单位:KB * sizeOf():计算缓存对象的大小,单位要一致 * entryRemoved():移除旧缓存时调用 */ int m ...

  4. 内存保护机制及绕过方法——通过伪造SEHOP链绕过SEHOP保护机制

    1.1    SEHOP保护机制 1.1.1    SEHOP工作原理: SEHOP保护机制的核心就是检查SEH链的完整性,其验证代码如下: BOOL RtlIsValidHandler(handle ...

  5. RabbitMQ(1) 核心概念

    消息中间价 消息中间价,也称消息队列,是分布式式系统中常用的中间价. 通过消息中间价传递消息,使得各个子系统解耦,异步通信. 目前业界有许多消息队列的实现,如RabbitMQ.Kafka.Active ...

  6. Request header field Content-Type is not allowed by Access-Control-Allow-Headers

    今天遇到一个跨域问题记录学习下: 一.问题: 跨域请求中包含自定义header字段时,浏览器console报错. Request header field xfilesize is not allow ...

  7. 【linux】VirtualBox-“please use a kernel appropriate for your cpu”

    This kernel requires the following features not present on the CPU:paeUnable to boot – please use a ...

  8. Alpha冲刺(2/10)

    前言 队名:拖鞋旅游队 组长博客:https://www.cnblogs.com/Sulumer/p/9960487.html 作业博客:https://edu.cnblogs.com/campus/ ...

  9. ubuntu maven install&config

    可以通过命令直接安装,我还是用文件安装. 1,下载apache-maven-3.5.0-bin.tar.gz二进制压缩文件 https://maven.apache.org/download.cgi ...

  10. EasyPlayerPro安卓流媒体播放器实现Android H.265硬解码流程

    本文转自EasyDarwin团队成员John的博客:http://blog.csdn.net/jyt0551/article/details/74502627 H.265编码算法作为新一代视频编码标准 ...