Opening a new terminal and typing the command firefox& inside, ps -l gives :
4 R 1000 23132 23104 99 80 0 - 2177945 - pts/27 00:00:07 firefox If the shell is closed with the command exit, the firefox child process becomebecomes an orphan andbut stays open with PPID 1.
The result of ps -el|grep firefox is then :
4 S 1000 23132 1 14 80 0 - 2233312 poll_s ? 00:00:21 firefox But if the terminal is closed (instead of closing the shell with exit), firefox is closed as well.
What is happening there ? Is SIGTERM sent to the terminal, the bash shell and all child processes ?
Is there a command that has the same effect as closing the terminal that can be used in the shell ?