2

I have a script running behind the screen which has a command nc -k -l 12345. Is there any workarounds I could kill this daemon without restarting the machine?

Ubuntu 14.04

muru
  • 193,181
  • 53
  • 473
  • 722
Anonymous Platypus
  • 3,730
  • 10
  • 33
  • 51

1 Answers1

4

If that nc process was started with exactly that command, and no other nc processes have exactly that command, you can do:

sudo pkill -fx 'nc -k -l 12345'
  • -f matches the entire command line
  • -x makes the match exact.
muru
  • 193,181
  • 53
  • 473
  • 722