Common Commands in CentOS7#
System Commands#
-
Check runlevel:
runlevelKnowledge about runlevel commands:
0: Shutdown 1: Single-user text mode (password recovery) 2: 3: Multi-user text mode 4: 5: Multi-user graphical mode 6: Reboot -
Switch runlevel:
init -
Clear screen command:
clear
Network Commands#
-
View local IP:
ip addr -
Test network connectivity:
ping
Service Commands#
systemctl: Manage services
systemctl service_name status: Check service status
systemctl service_name stop: Stop service
systemctl service_name start: Start service
systemctl service_name restart: Restart service
systemctl service_name enable: Enable service at startup
systemctl service_name disable: Disable service at startup
getenforce: Check the status of selinux
setenforce: Set selinux status
Other Commands#
echo: Print message
tar -z