1. Two commands running in the background & and CTR + z
At the beginning, the + "&" method is as follows: [command] space [&]
For example:
[Root @ pcmxexweb etc] # Find/-name xml &
In this way, the lookup program runs in the background. It does not affect other tasks.
But sometimes I forget to add the '&' symbol after the command, and I am not willing to stop the command and rewrite it again. You can press [Ctrl + Z] to switch the current program to the background.
[Root @ pcmxexweb etc] # Find/-name XML
/Etc/XML
/Usr/lib64/python2.4/XML
/Usr/share/Vim/vim70/autoload/XML
/Usr/share/maid/data/XML
/Usr/share/Java-utils/XML
/Usr/share/XML
/Usr/share/doc/libvorbis-devel-1.1.2/XML
/Usr/local/Apache-Tomcat-6.0.14/webapps/examples/JSP/XML
/Webapp/web/JSP/XML
[Root @ pcmxexweb etc] # Find/-name XML
/Etc/XML
/Usr/lib64/python2.4/XML
/Usr/share/Vim/vim70/autoload/XML
/Usr/share/maid/data/XML
/Usr/share/Java-utils/XML
/Usr/share/XML
[1] + stopped find/-name XML
However, note that the program in the background is in the stopped state (check the last line above ).
Use jobs to view programs running in the background.
[Root @ pcmxexweb etc] # jobs
[1]-stopped find/-name XML
[2] + stopped VI/etc/hosts
You can use the command BG 2. The effect is the same as that of using find/-name xml & at the beginning, so that this command runs in the background.
2. Transfer the background program back to the foreground
According to jobs, the corresponding program is redeployed back to the front-end by using FG 2.