3

I found out from http://www.tecmint.com/12-top-command-examples-in-linux/ (it's number 7 on that webpage) that you can use the k option to terminate a program. Would that work in the same way as quitting top and using kill?

2 Answers 2

2

The command kill can be used to send a signal to a process. Useful signals, as in man, are: HUP, INT, KILL, STOP, CONT, and 0.

Example:

sudo kill -9 1234 - send signal KILL to process with pid 1234

top can be used to watch Linux processes. There is an option on this command to send signals to processes too. You should already know process PID:

  1. After starting top, find process you would like to send a signal.
  2. Press k.
  3. Inform for which PID you would like to send signal.
  4. Inform which signal you want and press enter.
  5. Signal will be sent to process PID.

Want to know more about Linux Signals?

1

Exactly the same. They both need a PID and signal to send.

By default they both send SIGTERM and you can pick another signal to send too.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .