1、命令行运行

sudo tzselect

2、选择洲区(这里选择亚洲Asia)

waichung@desktop:~$ sudo tzselect
[sudo] password for waichung:
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
) Africa
) Americas
) Antarctica
) Arctic Ocean
) Asia
) Atlantic Ocean
) Australia
) Europe
) Indian Ocean
) Pacific Ocean
) none - I want to specify the time zone using the Posix TZ format.
#?

3、选择国家(这里选择中国China)

Please select a country.
) 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
#?

4、选择北京时间

Please select one of the following time zone regions.
) Beijing Time
) Xinjiang Time
#?

5、选Yes

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

方式1:在用户目录的.profile文件中加入一行下列内容,然后source ~/.profile使其生效

export TZ='Asia/Shanghai'

方式2:复制相应的时区文件到/etc目录下

sudo cp /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime

6、同步时间

waichung@desktop:~$ sudo ntpdate pool.ntp.org
May :: ntpdate[]: adjust time server 193.228.143.14 offset -0.154279 sec

Ubuntu使用tzselect修改时区的更多相关文章

  1. ubuntu下如何修改时区和时间

    1.修改时区 sudo tzselect (按提示选择即可) sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 2. 修改时间 sudo ...

  2. Ubuntu 14.04 修改时区

    执行下面命令,并按照提示选择"Asia/Shanghai": sudo dpkg-reconfigure tzdata 正常执行结果为: Current default time ...

  3. Linux服务器修改时区时间

    时间的一致性很关键,对于日志的分析和程序的对接都至关重要! 01.tzselect 修改时区 可以使用命令 tzselect,修改时区.操作示例: $ tzselect Please identify ...

  4. ubuntu server修改时区

    公司用的是ubuntu server 服务器在美国亚马逊VPS 现在要修改时区 执行:tzselect 或直接修改 /etc/timezone 文件,我是改成(America/Los_Angeles) ...

  5. Linux —— 时间(tzselect、timedatactl命令,查看和修改时区,修改时区为东八区)【转】

    转自:https://blog.csdn.net/weixin_42167759/article/details/90648225 一.设置linux修改时区首先查看当前时区 #date -R显示结果 ...

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

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

  7. ubuntu下修改时区

    使用一个虚拟机服务,其时区设置的为格林兰标准时区,我北京时区在东八区,较其快八个小时. 修改时区需要执行 tzselect 一步步选择下来,注意确认后的information Therefore TZ ...

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

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

  9. Ubuntu修改时区和时间

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

随机推荐

  1. 脱壳系列(五) - MEW 壳

    先用 PEiD 看一下 MEW 11 1.2 的壳 用 OD 载入程序 按 F8 进行跳转 往下拉 找到这个 retn 指令,并下断点 然后 F9 运行 停在该断点处后再按 F8 右键 -> 分 ...

  2. OD 实验(十九) - 对多态和变形程序的逆向

    程序: 这个窗口显示这是一个需要去除的 Nag 窗口 点击“确定” 用 PEiD 看一下 这是一个用汇编语言写的程序 逆向: 用 OD 载入程序 Nag 窗口的标题和文本 右键 -> 查找 -& ...

  3. RSA_JS_PHP加密解密

    root@DESKTOP-I4OIMJC /cygdrive/e/html/RSA_JS_PHP/openssl/bin # ./openssl.exe OpenSSL> genrsa -out ...

  4. PHP对全局变量_GET、_POST中特殊字符的过滤

     $sVariablesOrder = ini_get( 'variables_order' );      $request = array();      //过滤不安全数据   for ( $i ...

  5. 小酌Jmeter4.0新版本特性

    1.  首先下载打开jmeter4.0,说一个能感受到的视觉变化,如图, 黑色界面,不少朋友认为做技术黑色的东西看起来高上大一点,虽然这个观念有点肤浅,但似乎也有点道理,毕竟还是有不少朋友热衷于lin ...

  6. Oracle 创建表空间借鉴 保留,占版权留言告知

    /*分为四步 */ /*第1步:创建临时表空间 */ create temporarytablespace user_temp tempfile 'D:\oracle\oradata\Oracle9i ...

  7. 在线浏览office 文件

    http://blog.csdn.net/binyao02123202/article/details/20051683 [Asp.net]常见word,excel,ppt,pdf在线预览方案,有图有 ...

  8. ffmpeg基本用法(转)

    FFmpeg FFmpeg 基本用法 本课要解决的问题 1.FFmpeg的转码流程是什么? 2.常见的视频格式包含哪些内容吗? 3.如何把这些内容从视频文件中抽取出来? 4.如何从一种格式转换为另一种 ...

  9. Nginx在Windows下的使用与配置

    前往官网下载对应的windows版本 官网 下载后进入安装目录,启动命令行窗口,输入: nignx -c conf\nginx.conf 则nginx服务器已经启动. 打开浏览器,在标题栏输入: lo ...

  10. Boost在Linux 64 下的编译

    1. 下载最新版的boost wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz 2. 解压 ...