I\'m running a nohup process on the server. When I try to kill it my putty console closes instead.
this is how I try to find the process ID:
ps -ef |
About losing your putty
: often the ps ... | awk/grep/perl/...
process gets matched, too! So the old school trick is like this
ps -ef | grep -i [n]ohup
That way the regex search doesn't match the regex search process!
You could try
kill -9 `pgrep [command name]`
This works for mi fine on mac
kill -9 `ps -ef | awk '/nohup/{ print \$2 }'`
jobs -l should give you the pid for the list of nohup processes. kill (-9) them gently. ;)
This works in Ubuntu
Type this to find out the PID
ps aux | grep java
All the running process regarding to java will be shown
In my case is
johnjoe 3315 9.1 4.0 1465240 335728 ? Sl 09:42 3:19 java -jar batch.jar
Now kill it kill -9 3315
The zombie process finally stopped.
when you create a job in nohup it will tell you the process ID !
nohup sh test.sh &
the output will show you the process ID like
25013
you can kill it then :
kill 25013