[内容] 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

[CONTENT] Linux common parameters of /etc/fstab file

/dev/vg/lv_var /var xfs nodev,nosuid,noexec 0 0
/dev/vg/lv_var_log /var/log xfs nodev,nosuid,noexec,x-systemd.requires-mounts-for=/var 0 0

(
Add:
1) nodev parameter here means this directory can not be interpreted by devices or blocks
2) nosuid parameter here means no setuid files can be created in this directory
3) noexec parameter here means no files can be executed in this directory
4) x-systemd.requires-mounts-for=/var here parameter means /var/log directory can not be mounted until /var directory has been mounted
)

[CONTENT] Linux recommended swap size

Content:

For RHEL 6, RHEL 7, RHEL 8, RHEL 9

RAM sizeRecommended swap sizeRecommended swap size if allowing for hibernation
From 0 to 2GB 2 times the RAM size3 times the RAM size
From 2GB to 8GBThe same size of the RAM2 times the RAM size
From 8GB to 64GBAt least 4GB1.5 times the RAM size
From 64GBAt least 4GBHibernation is not recommended
RHEL 6, RHEL 7, RHEL 8, RHEL 9 Recommended Swap Size Table

Note: A 100GB swap is recommended if system with over 140 logical processes or over 3TB RAM

Reference:

https://access.redhat.com/solutions/15244

[内容] rm 命令确认步骤的取消

内容一:给某个用户单独取消 rm 命令的确认步骤

1.1 修改 ~/.bashrc 文件

# vi ~/.bashrc

添加以下内容:

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

1.2 重新登录用户

(步骤略)

内容二:全局永久设置取消 rm 命令的确认步骤

2.1 修改 /etc/bashrc 文件

# vi /etc/bashrc

添加以下内容:

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

2.2 重新登录用户

(步骤略)