nohup 与 &, 不挂起与后台
2019-02-20 09:35
26 查看
版权声明:All right reserved 未经允许,禁止转载 https://blog.csdn.net/a308601801/article/details/87775035
1.nohup
意思:no hang up 的缩写,不挂断
用途:不挂断地运行命令
语法:nohup Command [ Arg … ] [ & ]
无论是否将 nohup 命令的输出重定向到终端,输出都将附加到当前目录的 nohup.out 文件中。
如果当前目录的 nohup.out 文件不可写,输出重定向到 $HOME/nohup.out 文件中。
如果没有文件能创建或打开以用于追加,那么 Command 参数指定的命令不可调用。
退出状态:该命令返回下列出口值:
126 可以查找但不能调用 Command 参数指定的命令。
127 nohup 命令发生错误或不能查找由 Command 参数指定的命令。
否则,nohup 命令的退出状态是 Command 参数指定命令的退出状态。
2.&
用途:在后台运行, 一般两个一起用 nohup command &
eg:
[code]nohup /opt/module/kafka/bin/kafka-server-start.sh /opt/module/kafka/config/server.properties 2>&1 >/dev/null &
/dev/null 的作用
相关文章推荐
- Linux命令-进程后台执行:nohup(就是不挂起的意思)
- Linux 后台执行命令,退出 程序不挂起之nohup
- Linux_Linux命令_nohup_后台挂起进程_一些使用事项
- linux 后台进程 挂起 暂停
- Linux后台进程挂起通用做法
- Linux 技巧:让进程在后台可靠运行的几种方法nohup|
- linux后台执行命令:&和nohup
- nohup-真正的Shell后台运行
- Linux运行与控制后台进程的方法:nohup, setsid, &, disown, screen
- linux nohup, jobs, fg, tail指令 指令前后台切换
- SecureCRT异常关闭,后台进程中断原因及解决办法---nohup
- Linux的后台执行进程之nohup
- linux进程后台运行的几种方法 - nohup/setsid/&/disown/screen
- 后台执行jar不产生nohup.out
- 解决python nohup linux 后台运行输出的问题
- nohup使用密码在后台运行
- nohup后台执行脚本并输入日志到指定目录 &
- nohup 程序永久后台运行
- nohup 后台运行命令
- nohup命令让程序运行于后台