Page 41 - Raspberry Pi as a Foundation for Boosting Computer and Technology Literacy
P. 41
Overview of shell commands 3.3
Figure 3.14 Checking the CPU used by the user and kernel spaces via the top
command
CPU power and RAM are being used. One can also take note of the user
and system CPU times (us and sy, respectively), which represent the
percentage of CPU time spent in user and kernel space (Figure 3.14).
Like any other running process within the terminal window, the top
command can be terminated (i.e. exited in this case) by pressing the
key combination ‘CTRL+C’.
Alternatively, one can use the htop command, which offers the
same functionality as top but with greater convenience. To illustrate
this, one could execute the htop command, navigate to the “lxtermi-
nal” process within the menu using the arrow keys, press ‘F9’ to kill the
process, and finally press ‘Enter’ to confirm (Figure 3.15). This action
should result in the terminal window closing as its process has been
terminated.
Figure 3.15 Example of terminating a process in htopmand
41