美文网首页
Linux Set Locale

Linux Set Locale

作者: hynial | 来源:发表于2021-03-20 11:48 被阅读0次

    Current locale

    $ locale
    

    All Available locale

    locale -a
    

    Details of a Specific Variable

    locale -c -k LC_TIME
    

    Change locale

    vim ~/.bashrc
    LANG="zh_CN.utf8"
    LC_ALL="zh_CN.utf8"
    export LANG
    export LC_ALL
    
    source ~/.bashrc
    

    You can find global locale settings in the following files:

    • /etc/default/locale – on Ubuntu/Debian
    • /etc/locale.conf – on CentOS/RHEL

    The following command sets LANG to en_IN.UTF-8 and removes definitions for LANGUAGE.

    $ sudo update-locale LANG=LANG=en_IN.UTF-8 LANGUAGE
    OR
    $ sudo localectl set-locale LANG=en_IN.UTF-8
    

    To configure a specific locale parameter, edit the appropriate variable. For instance.

    $ sudo update-locale LC_TIME=en_IN.UTF-8
    OR
    $ sudo localectl set-locale LC_TIME=en_IN.UTF-8
    

    Ubuntu

    sudo apt-get install locales
    sudo locale-gen zh_CN.UTF-8
    sudo localedef -c -f UTF-8 -i zh_CN zh_CN.utf8
    

    相关文章

      网友评论

          本文标题:Linux Set Locale

          本文链接:https://www.haomeiwen.com/subject/cztwcltx.html