Where Do Npm Background Scripts Go?
Solution 1:
So the background processes go into the background just running inside the OS but not attached to your shell's tty. To find them, use jobs -l
or the ps
command with something like ps -ef
. You can use grep
to filter the output, but what you need to find is the process ID (PID) of your build process so you can stop it with kill <pid>
. You may also want to read up on pgrep
and pkill
which are handy for this process.
Note that in your example you use bg
when it's not appropriate. bg
is for this sequence: 1. start a job in your shell's foreground, 2. suspend that job with CTRL-Z, 3. use bg
to tell the shell "allow this job to continue executing, but detached from my tty in the background". (again, jobs
is what you are looking for here).
For the bigger picture, there's no need or benefit of running that coffee
command in the background as it is just a simple compliation step that should take on the order of a few milliseconds.
For an amazingly-detailed "reread every year" level of depth, check out The TTY demystified.
Post a Comment for "Where Do Npm Background Scripts Go?"