Ubuntu – How to run a shell script in background

command linescripts

How can I run a shell script in background?

Best Answer

Depending on what you are wanting, just add a & to the end of the command

script.sh &
command &

If you are running it in a terminal, and you want to then close the terminal, use nohup or disown


nohup script.sh &


script &

If that is not what you are after, please be more specific in your question.