Linux command goes to the background to run

Linux command goes to the background to run

When we execute Shell commands under Linux system, the running time may be very long. During this period, if the network is disconnected or the client is closed, the execution of this command will be interrupted.

When this happens, we need a way to move the executing command to the background for execution. Proceed as follows:

CTRL+Z 先暂停这条命令并返回客户端。
bg 命令让这条shell命令在后台执行。
disown -h 这条命令保证当终端关闭时,Shell脚本不会被杀死。

After these three commands are executed, the Shell command being executed will be moved to the background to run.

Guess you like

Origin blog.csdn.net/Asia1752/article/details/112340717