Skip to main content

15.6) Looking At Running Programs


Now open a new Unix window (right click on the background and select console). If you now type top you will see ‘runit’ and you can see the information about your program as it is running. ]Have a look at the PID number (process ID number), the amount of memory and cpu used and how long it has been running.
There are many reasons to want to stop a program. You may have realized that it isn’t performing the calculation you need or maybe is running with the wrong inputs, etc. If you realized that you made a mistake in your program and you wanted to stop it then there are two ways. In the window that it is running in you can type ‘ctrl’ and ‘c’ at the same time and this will stop or kill the program. In the future, you will want to run jobs in the background that no longer appear in a window and in that case you will need to use your top window to kill the job. In that top screen type ‘k’ (for kill) and enter the PID number for the ‘runit’ program and hit return. It will ask you for a signal and enter ‘9’ and hit return. The signal is how you want to stop the job and ‘9’ will stop it immediately. Look in the other window and you will see that the program has been stopped.