Unpack the

Gz file in the tar XVZF jdK-xxx_linux-x64_bin.tar. gz format

Configure environment variables that are valid only in the current command line session

export JAVA_HOME=/root/jdk-XXX_linux-x64
export PATH=$JAVA_HOME/bin:$PATH 
Copy the code

Vim. Bashrc file of the current user. If the export command is written to the file, it takes effect globally permanently.

nohup command >out.file 2>&1 &
Copy the code

Nohup means no hang up, >out.file means program output to a file, 2>&1 means standard output and standard error output are combined, and & means background run

Ps - ef | grep keyword | awk '{print $2}' | xargs kill 9Copy the code

Close the process. Ps -ef lists all running programs, awk ‘{print $2}’ prints the second column, and xargs passes the result of the above operation to kill -9.

The program runs as a service:

Systemctl start mysql // Starts the mysql service systemctl enable mysql // allows the mysql service to start when the system startsCopy the code

The /lib/systemd/system directory contains the service configuration file.