---
title: "linux 脱机管理（nohup）"
author: "eksliang"
date: "2014-12-17T19:46:25Z"
tags: []
categories: ["研发管理"]
slug: "linux-nohup"
draft: false
lastmod: "2015-01-12T09:02:32Z"
id: 2166699
url: "https://eksliang.iteye.com/blog/2166699"
---

# 脱机管理 nohup

转载请出自出处：[http://eksliang.iteye.com/blog/2166699](/blog/2166699)

nohup可以让你在脱机或者注销系统后，还能够让工作继续进行。他的语法如下

```
nohup [命令与参数]   --在终端机前台工作
nohup [命令与参数] & --在终端机后台工作
```

 

但是这个命令需要注意的是，nohup并不支持bash的内置命令，所以你的命令必须是外部命令才行

参考实例如下：

```
[root@localhost test]# nohup ./test.sh
nohup: ignoring input and appending output to `nohup.out' 

[root@localhost test]# nohup ./test.sh &
[1] 3060
```

     用nohup去把一个命令扔到系统后台去跑，会生成“~/nohup.out"这个文件，因为nohup的执行与终端无关了，他已经在后台跑了，所以会把你的输出重定向到“~/nohup.out"文件下面