scripts command-line – 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

nohup script.sh &

disown

script &
disown

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