If you're using Bash, you can run disown -h job
disown
disown [-ar] [-h] [jobspec ...]
Without options, each jobspec is removed from the table of active jobs.
If the -h
option is given, the job
is not removed from the table, but is
marked so that SIGHUP is not sent to
the job if the shell receives a
SIGHUP. If jobspec is not present, and
neither the -a
nor -r
option is
supplied, the current job is used. If
no jobspec is supplied, the -a
option means to remove or mark all
jobs; the -r
option without a
jobspec argument restricts operation
to running jobs.
cat /proc/<pid>/environ
If you want to have pid(s) of a given running executable you can, among a number of other possibilities, use pidof
:
AlberT$ pidof sshd
30690 6512
EDIT:
I totally quote Dennis Williamson and Teddy comments to achieve a more readable output.
My solution is the following:
tr '\0' '\n' < /proc/<pid>/environ
Best Answer
Oh, god! No no no. Don't use kill -9.
It doesn't give the process a chance to cleanly:
shut down socket connections
clean up temp files
inform its children that it is going away
reset its terminal characteristics and so on and so on and so on.
Generally, send 15, and wait a second or two, and if that doesn't work, send 2, and if that doesn't work, send 1. If that doesn't, REMOVE THE BINARY because the program is badly behaved!
Don't use kill -9. Don't bring out the combine harvester just to tidy up the flower pot.