<> Common commands

<> View process and port number

View the process number of an application , For example, check tomcat Process number of (tomcat Start or not )
ps -ef | grep tomcat
ps -ef This means that all processes are displayed in long format ,grep tomcat Is to find and characters in all processes tomcat Related processes , And show it .

first root Represents the activation of the tomcat Users of , the second 32298 It's the process ID, Third It's occupation CPU Percentage of , The fourth is the percentage of memory used .

The other one on the top 21379 It means you use it grep This process of .

According to process number (PID) View the port number occupied :
netstat -anop | grep 32298

hear tomcat Occupied port number 80, There's more in it 8009 and 8005, This is all by default tomcat Some ports for listening , such as 8005, When implemented shutdown.sh close tomcat Time is connection 8005 Port execution “SHUTDOWN” command .

<> View port occupancy

lsof -i:80 see 80 The process information occupied by the port, etc

<> Firewall related

View firewall status systemctl status firewalld
Turn off the firewall systemctl stop firewalld
Turn on the firewall systemctl start firewalld

<> Find directory

Technology