Run bash script without terminal

How can I make a bash script that keeps on running after I have closed the terminal?

Or a script that runs without having the terminal window open?

If you start the script using the nohup command it will make it immune to the hangup signal. It sends any output to nohup.out by default:

$ nohup myscript.sh &
nohup: ignoring input and appending output to `nohup.out'
$ exit
1 Like