使用nohup在后台执行命令 [英] command execution with nohup in background

查看:65
本文介绍了使用nohup在后台执行命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用nohup执行命令时,必须在后台执行该命令.

when executing a command with nohup , is that necessary to execute it in background.

如果唯一需要做的就是关闭终端时命令不应挂起,那么区别是什么(nohup命令&)和(nohup命令)?

If the only thing required is that the command should not hang when closed the terminal, then what is the differnce in ( nohup command & ) and ( nohup command ) ?

以上两种说法都能达到目的.

Both of the above statements achive this.

推荐答案

最后的& 表示该命令应在后台运行.这意味着,您可以继续在shell中输入命令.

The & at the end indicates that the command should be running in the background. That means, you can continue to enter commands into the shell.

对于您的特定问题,这似乎没有任何区别,因为您似乎想立即关闭终端窗口.

For your particular question, it does not make any difference as it seems you want to close the terminal window right afterwards anyway.

这篇关于使用nohup在后台执行命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆