Hereby: Liu Chao
Interesting about the Linux operating systemThis column is the source of most of the content and images in this article.

To run the program

There are several ways to have Linux execute programs from the command line and determine how the process has been run. 1. Interactive operation

$./filename # Ctrl+C can terminate the executing process

2, background mode operation

# run out of background and output the log to the file XXX. Outfile. The # nohup command shuts down the terminal without affecting the process (the normal process is forked by the terminal process, the parent process is suspended....). , 2, 3, & > 1 incorporating standard output error output to XXX. The outfile, & the background setting process $nohup. / the command > XXX. Outfile & > 1 & 2 # # ps - the background process ef | grep keyword filtering process information, By awk '{print $2} to find out the process id, and then passed on through xargs command to kill 9, eventually kill the process ps - ef | grep keyword | awk' {print $2} '| xargs kill 9 # kill the process

3. Operation of service mode

$systemctl enable service-name $systemctl start service-name $systemctl stop service-name.....

Now there’s a small problem

Q: Processes and services running in the background can exist independently of the terminal, so what is the difference between them?


<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


A: check the
System servicesSumming up two differences: 1. Service is the process of system function; 2. A process is the user’s process. 2. The service does not interact with the user and runs silently in the background (just like the background process).




Install the software

For both Ubuntu and CentOS Linux distributions, there are several ways to install software: download the installation package, use the software manager, download the zip directly, or use source code compilation. 1. Download the installation package and install

$dpkg-i xxx.deb # if chentos, use RPM command

2. Install it through the software manager

$apt-get install $apt-get install $apt-get install $apt-get install $apt-get install $apt-get install

3. Download the zip package for installation

Export PATH=XXX/bin:PATH # Add the executable file bin to the PATH variable. Configure this command in the ~/.bashrc file and load this file every time you restart Linux

4, source code compilation and installation

$./configure --prefix=/usr/local/program # $make # $make install --prefix=/usr/local/program

conclusion

Homework after class

The after-class requirement is to install JDK and MySQL and build a database service. I didn’t do it, but I did find a useful tutorial for deploying a dynamic Web environment using the LNMP architecture

The resources

  • Pick up a few Linux commands quickly: Every company has its own slang