1.檢視系統是否安裝中文語言包 (列出所有可用的公共語言環境的名稱,包含有zh_cn)
locale -a |grep "zh_cn"
2.修改配置檔案
雖然安裝了中文語言包但本機的語言環境並不是中文,需要修改locale.conf配置檔案在修改配置檔案之前,我們先看看當前系統語言環境
locale
lc_ctype="zh_cn.utf-8"
lc_numeric="zh_cn.utf-8"
lc_time="zh_cn.utf-8"
lc_collate="zh_cn.utf-8"
lc_monetary="zh_cn.utf-8"
lc_messages="zh_cn.utf-8"
lc_*****="zh_cn.utf-8"
lc_name="zh_cn.utf-8"
lc_address="zh_cn.utf-8"
lc_telephone="zh_cn.utf-8"
lc_measurement="zh_cn.utf-8"
lc_identification="zh_cn.utf-8"
lc_all=
也可以使用命令修改locale.conf配置檔案vim /etc/locale.conf
lang="zh_cn"
source /etc/locale.conf
接著修改/etc/profile檔案localectl set
-locale lang=zh_cn
驗證是否成功vim /etc/profile
export lang=zh_cn.utf-8
source /etc/profile
ll
-rw------
-. 1 root root 1901 11月 30 18:18 anaconda-ks.cfg
-rw-r--r--
. 1 root root 1949 11月 30 18:19 initial-setup-ks.cfg
drwxr-xr-x. 2 root root 6 11月 30 18:19 公共
drwxr-xr-x. 2 root root 6 11月 30 18:19 模板
drwxr-xr-x. 2 root root 6 11月 30 18:19
drwxr-xr-x. 2 root root 6 11月 30 18:19 文件
drwxr-xr-x. 2 root root 6 11月 30 18:19 **
drwxr-xr-x. 2 root root 6 11月 30 18:19 桌面
centOs6中文亂碼
1 說明 windows的預設編碼為gbk,linux的預設編碼為utf 8。在windows下編輯的中文,在linux下顯示為亂碼。為了解決此問題,修改linux的預設編碼為gbk。2 檢視支援的字符集 locale a 3 安裝英文版預設的字符集配置為 cat etc sysconfig i18...
CentOS 7 3 填坑之路
e.不知道命令怎麼用,一般都會有help幫助,例子vi help,命令後加 help就會顯示 f.按2次tab鍵會列出當前資料夾下的所有檔案,如果輸入了 再按兩次tab則會自動補全或列出以 開頭的資料夾及檔案 g.常用shell命令 h.linux預設路徑為絕對路徑,及任意路徑下cd 意味著你將轉到...
CentOS7 3安裝部署wordpress
centos7.3安裝部署wordpresswordpress簡介 wordpress是使用php語言開發的部落格平台,使用者可以在支援php和mysql資料庫的伺服器上架設屬於自己的 也可以把 wordpress當作乙個內容管理系統 cms 來使用。root luchao yum install ...