Several ways to run linux script

1. Common script

Run in the current session, ctrl + c can be interrupted

./test.sh

2. Use the & symbol to execute commands in the background

Running in the background of the current session, ctrl + c cannot be interrupted, but if the current session is launched, the script will terminate

./test.sh &

3. Use nohup to execute commands in the background

Run in the background, exit the current session can not terminate the script, if you need to stop the foot to kill with the kill command

nohup ./test.sh &

Guess you like

Origin www.cnblogs.com/makalochen/p/12736392.html