1

I am a linux newbie so this maybe a very stupid question, I will try to ask my question by giving an example. When I execute command in terminal

chromium-browser

chromium opens up but I cannot close the terminal without closing the browser. when I quit the terminal browser closes automatically So I wanted know how to close that terminal without closing the browser.

Shubh
  • 21

3 Answers3

3

You can do it by running something like this from the terminal:

chromium-browser &
disown

You need to disown the program from the terminal.

More information about disown:

~$ disown --help
disown: disown [-h] [-ar] [jobspec ... | pid ...]
    Remove jobs from current shell.
Removes each JOBSPEC argument from the table of active jobs.  Without
any JOBSPECs, the shell uses its notion of the current job.

Options:
  -a    remove all jobs if JOBSPEC is not supplied
  -h    mark each JOBSPEC so that SIGHUP is not sent to the job if the
        shell receives a SIGHUP
  -r    remove only running jobs

Exit Status:
Returns success unless an invalid option or JOBSPEC is given.

Terrance
  • 41,612
  • 7
  • 124
  • 183
2

You need to disassociate the browser from the terminal. I think this is the sequence:

chromium-browser </dev/null >/dev/null 2>&1 &
# or
nohup chromium-browser &

disown exit

glenn jackman
  • 17,900
1

Place an & after any command you want to run in background after the terminal exits.

chromium-browser &

should do the trick.
Reference to StackOverflow question explaining it

Dennis
  • 2,473