(Bash) `jobs` options
- Adding
-l
flag also prints out the PID of each job in addition to job ID, which may be handy for e.g. subsequentkill -9
. Specifying-p
instead ONLY prints out the PIDs. - Adding
-s
flag letsjobs
only print out the stopped jobs, e.g. below kills all stopped jobs:sudo kill -9 `jobs -p -s`
The opposite is
-r
which prints out only the running jobs.
References:
Written on October 19, 2021