1) Add an ampersand ("&") to the end of the command line.
$ bgcommand &
2) Use nohup
$ nohup bgcommand
However, if you are anything like me, you will constantly forget to do this so in such cases you will want to move your process to a background process.
We can do this using CTRL+z to suspend the command and then "bg" to move it to the background.
$ CTRL+Z
$ bg
Now your command continues executing but you are able to enter new commands on the console.
However, if you close or lose that console for whatever reason then the background process will be killed. To avoid this you need to detach the process using the disown command.
$ disown -a
Nice!
No comments:
Post a Comment