使用nohup
命令:在要运行的命令加上nohup和&,如果出现了
例如 nohup ./xxx.sh &
nohup: ignoring input and appending output to ‘nohup.out’
敲击回车就行了。
如果要解决,
1、原因
是因为使用 nohup 会产生日志文件,默认写入到 nohup.out
2、解决
将 nohup 的日志输出到 /dev/null,这个目录会让所有到它这的信息自动消失
nohup ./xxx.sh > /dev/null 2> /dev/null &