Recently, due to work requirements and frequent access to Linux, we listed frequently used commands for future reference.
1. PS-Ef | grep process name (this process name can be a fuzzy value)
According to the query results, you can get the process number, namely, PID, and then force kill-9 PID to kill the process.
This command is frequently used due to the recent maintenance of Linux projects. Our projects are developed in windows and then deployed on Linux, in each regression test, the modified files are sent to me, And then uploaded to the corresponding directory to overwrite the original source files, for example: JS files, compiled class files, etc. In this way, the server needs to be restarted, so the process must be killed first. Otherwise, the port is occupied.
2. VI file name
This command is used to modify the file content. At that time, because the development environment and test environment are not on the same server, the application must be modified frequently. the database IP address in the properties file, so this command is frequently used.
3../Catalina. Sh run &
Since Tomcat is the server used in the recent project, it is particularly important to start and close Tomcat server commands. Go to the bin directory under the Tomcat directory, enter./Catalina. Sh run &, and press Enter. Use this command to view the log information printed during the startup process, for example, whether the port number is occupied. "&" Indicates that after the command is executed, you can press enter again, and then enter other commands, the "&" symbol can be used to run the command in the background .. The/startup. Sh command can also start the Tomcat server. However, if the SSH window is closed, the Tomcat server is also closed.
4 ../shutdown. Sh
This command is used to shut down the Tomcat server. Enter the bin directory under the Tomcat directory, enter./shutdown. Sh, and press Enter.
5. Su-Oracle
It is equivalent to logging on again. The user's home directory, path, and other information will change.
6. Su Oracle
After switching to the Oracle Identity, the user's home directory and path are still the original user's home directory and Path