1. View CPU Information
Lscpu
2, network configuration
IP Route View Route
Nmcli
NMCLI connection Show Show all connections
NMCLI Connection Show-a shows only the currently active connection
NMCLI Device status Lists the list of devices identified by NetworkManager and their status
NMCLI Device Disconnect eno16777736 Stop interface
NMCLI device connect eno16777736 boot interface
Nmtui setup in a similar CENTOS6
Configure host Name
/etc/hostname
Hostnamectl
Hostname
3, System language Settings
The locale configuration file is/etc/locale.conf, and is set by the LOCALECTL command;
Localectl Status View current configuration
Localectl list-locales |grep CN View available regional languages
Localectl Set-locale Lang=zh_cn.utf8 Setting the regional language
4, configure time and date
Timedatactl Date
Timedatectl equivalent to TIMEDATECTL status
Timedatectl set-time YYYY-MM-DD Set Date
Timedatectl Set-time HH:MM:SS Set Current time
Timedatectl SET-LOCAL-RTC Boolean default, the system uses UTC time, you can turn UTC time on and off with the following command
Replacing a Boolean with yes means that the local time is used, and the replacement of no means UTC time
Note: The Boolean value here can also be true, flase
Timedatectl List-timezones View all time zones
Timedatectl set-timezone time_zone Use the command to set the time zone
You can also copy system files directly by setting the time zone:
Timedatectl SET-NTP Boolean Timedatectl can also set whether the NTP option is turned on (boolean yes or no here)
# Cp/usr/share/zoneinfo/asia/shanghai/etc/localtime
5, clock synchronization configuration
/etc/chrony.conf
Timedatectl
Ntpdate
6,strace Ltrace
7, System Services
Systemctl-at Service
Ls/etc/systemd/system/*.service
Ls/usr/lib/systemd/system/*.service
View the active service
SYSTEMCTL-T Service--state=active
Start/Stop Service
Systemctl Start Name.service
Systemctl Stop Name.service
Set whether the boot service is started
Systemctl Enable Name.service
Systemctl Disable Name.service
View server Status
Systemctl Status Name.service
Check if the service is enabled
Systemctl is-enabled Name
Create a new service
Systemctl Daemon-reload/etc/systemd/system/*.service
8, run level
View
Who-r
RunLevel
Modify
Switch to: Run Level 3
Systemctl isolate Multi-user.target or Systemctl isolate Runlevel3.target
Switch to: Run Level 5
Systemctl isolate Graphical.target or Systemctl isolate Runleve5.target
To modify the boot default run level
SYSTEMD uses links to point to the default runlevel, as determined by the/etc/systemd/system/default.target file
Switch to run Level 3:
Delete First:/etc/systemd/system/default.target
Ln-sf/lib/systemd/system/multi-user.target/etc/systemd/system/default.target
Ln-sf/lib/systemd/system/runlevel3.target/etc/systemd/system/default.target
Or
Systemctl Set-default Multi-user.target
9, log
/var/log
Journalctl
10, configuring Grub
/etc/default/grub
Grub-set-default
Grub2-mkconfig
11. View hardware Information
LSHW (in EPEL)
Yum Install Epel-release-y
Yum Install Lshw-y
12. Load and configure kernel modules
Modprobe
removing kernel modules
Modprobe-r
View Kernel parameters
Sysctl-a
Cat/proc/cmdline
This article is from the "Stone" blog, please be sure to keep this source http://dodowolf.blog.51cto.com/793581/1755173
CENTOS7 Command Summary