linux nohup

发布时间 2023-07-12 15:11:21作者: burlingame

1,安装

yum install coreutils

2,查看安装路径

which nohup

3,查看版本号

nohup --version
nohup (GNU coreutils) 8.22
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jim Meyering.

4,nohup作用说明

nohup 英文全称 no hang up(不挂起),用于在系统后台不挂断地运行命令,退出终端不会影响程序的运行。

nohup 命令,在默认情况下(非重定向时),会输出一个名叫 nohup.out 的文件到当前目录下,如果当前目录的 nohup.out 文件不可写,输出重定向到 $HOME/nohup.out 文件中。

1、用途:LINUX命令用法,不挂断地运行命令。

2、语法:nohup Command [ Arg ... ] [&]

3、描述:nohup 命令运行由 Command 参数和任何相关的 Arg 参数指定的命令,忽略所有挂断信号。

4、在注销后使用 nohup 命令运行后台中的程序。要运行后台中的 nohup 命令,添加 &到命令的尾部。

 

使用格式:

 nohup Command [ Arg … ] [ & ]

example:

nohup /root/runoob.sh &

如果在终端看到下面所示的输出说明的话,就说明该nohup命令运行成功了:

appending output to nohup.out

在root用户下查看守护进行,看hohup执行是否成功: jps -ml | grep xxx 

或使用 ps -ef | grep xxx 查看是否执行成功

 

 

参考:

(18条消息) 解决:Linux下-bash: nohup: command not found或者bash: nohup: 未找到命令的问题_-bash: nohub: 未找到命令_Java全栈研发大联盟的博客-CSDN博客

(18条消息) nohup 命令之 nohup: ignoring input and appending output to ‘nohup.out’_水w的博客-CSDN博客