[linux] nohup - keeps job running at backend

Normally we log in a Linux machine using ssh. And when we logs out, those jobs started by the shell will get killed if they're not deamon or running at backend. [b]nohup[/b] is a useful tool to keep the job running at backend to prevent this "auto killed" behavior from happening.

Here's how to use it:


# nohup myjob &


We'll see something printed out:


appending output to nohup.out


Meaning it's up. All the output info of [i]myjob[/i] will be kept in nohup.out of the current directory.

If we logout, [i]myjob[/i] will keep running at the backend.

To kill [i]myjob[/i], normally we use the command below to find out the pid, and use the [i]kill[/i] command to stop the process.


ps -A | grep myjob
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值