day12_nohup

vi /tmp/echo.sh

#!/bin/sh

while :

do

echo "123" >>/tmp/echo.txt

done


chmod +x /tmp/echo.sh 


sh /tmp/echo.sh



nohup sh /tmp/echo.sh &


[oracle@db8 tmp]$ ps -ef|grep echo.sh
oracle    4452  3962 99 11:40 pts/1    00:00:12 sh /tmp/echo.sh
oracle    4466  3962  0 11:41 pts/1    00:00:00 grep echo.sh

kill -9 4452

[oracle@db8 tmp]$ ps -ef|grep echo.sh
oracle    4475  3962  0 11:41 pts/1    00:00:00 grep echo.sh
[1]+  Killed                  nohup sh /tmp/echo.sh




原文地址:https://www.cnblogs.com/xiaoxiao5ya/p/b6d8bd043087fc06a7be79e89ebde7ef.html