[内容] Linux locale 的设置 (系统语言格式的设置)

内容一:全局设置 locale

1.1 通过 localectl 命令设置 locale

# localectl set-locale LANG=en_US.UTF-8

(补充:这里以将 locale 设置为 en_US.UTF-8 为例)

1.2 通过修改 /etc/locale.conf 设置 locale

# vi /etc/locale.conf

将全部内容修改如下:

LANG=en_US.UTF-8

(补充:这里以将 locale 设置为 en_US.UTF-8 为例)

内容二:只给某个用户设置 locale

2.1 通过修改 ~/.bash_profile 设置 locale

# vi ~/.bash_profile

添加以下内容:

......
LANG=en_US.UTF-8

(补充:这里以给当前用户将 locale 设置为 en_US.UTF-8 为例)

2.2 通过修改 ~/.bashrc 设置 locale

# vi ~/.bashrc

添加以下内容:

......
LANG=en_US.UTF-8

(补充:这里以给当前用户将 locale 设置为 en_US.UTF-8 为例)

补充:查看系统支持的所有系统语言格式

# locale -a

[STEP] Limitation of the amount of the file which can be opened by Linux program

Step One: In system level, set the limitation of the amount of the files which can be opened by the user who running the Linux Program

# vi /etc/security/limites.conf

Add these lines:

......
rmt  -       nofile  1024
rmt  -       nproc   1024

(Add: Setting the rmt user can open 8192 files and 8192 processes in this Linux as an example here)

Step Two: In program level, check the setting of the amount of the files which can be opened by Linux program

# /bin/systemctl show 'rmt-server-mirror.service' | sort
......
LimitNOFILE=524288
......

(Add: The amount of opening the file by program rmt-server-mirror.service is limited at 8096 as an example here)

[内容] 硬盘的模式

Write-through (直写模式)

数据同时写如 Cache (缓存) 和硬盘。
优点是:不会出现突然断电掉数据的情况
缺点是:但是写入速度较慢

Write-back (回写模式)

数据先写入 Cache (缓存) ,再从 Cache (缓存) 写入硬盘。
优点是:写入速度较快
缺点是:突然断电存储在 Cache (缓存) 里的数据无法找回