Get the App
SLTechnology News&Howtos  ›  Servers  › 

Command for optimizing system Foundation and viewing system Information

Shulou Source: shulou.com Published: 2022-06-03 04:59:56 10月02日 Update

01. Basic optimization of operating system

1. Operating system character optimization

View the default encoding information:

Echo $LANG

En_US.UTF-8

Temporary modification:

LANG=zh_CN.utf8

Permanent modification:

Vi / etc/locale.conf

LANG= "zh_CN.utf8"

Temporary and permanent changes are made:

Localectl set-locale LANG= "zh_CN.gbk"

two。 System remote connection optimization

Vi / etc/ssh/sshd_config-remote service profile

115 UseDNS no-whether to enable the reverse parsing process of DNS

79 GSSAPIAuthentication no-whether or not GSSAPI certification

Systemctl restart sshd-restart service command

System prompt optimization

Special environment variable: PS1

[\ u@\ h\ W]\ $

[root@backup ~] #

\ u-indicates the user information of logging in to the system

\ h-represents host name information

\ W-display current path information

Temporary modification:

PS1=' [\ u@\ h\ w]\ $'

PS1=' [\ u@\ h\ W\ t]\ $'

Permanent modification:

Vi / etc/profile

PS1=' [\ u@\ h\ W\ t]\ $'

Modify the command prompt color:

PS1=' [\ e [32th 1m] [\ u@\ h\ W\ t]\ $[\ e [0m]'

① ② ③

[\ e [32th 1m]-string information add color numeric information to indicate different color font information is bold

[\ e [0m]-stop subsequent string color modification

02. System information viewing method

System information view

1) use system version information: centos 7.6

Cat / etc/redhat-release

Kernel: view kernel information uname-a

Hardware information query

CPU: view file information cat / proc/cpuinfo

Cpu Information lscpu

Memory: viewing file information cat / proc/meminfo

Memory information free-h

Disk: disk mount file information cat / proc/mounts

Mount information df-h

Load: system load file information cat / proc/loadavg

Load information w

Tags: Information system file color character permanent command operating system memory kernel string prompt disk prompt service foundation different special host variable Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information NVidia Linux OPPO Reno Docker