What is top or htop and how do you use it?

Answer

top is an interactive real-time process monitor showing CPU usage, memory usage, load average, and a list of running processes sorted by CPU consumption. Key interactions: press M to sort by memory, P for CPU, k then a PID to kill a process, q to quit. htop is an improved alternative with a color interface, mouse support, and horizontal scrolling for wide process information. Both show system load averages (1, 5, 15 minutes) — a load average above the number of CPU cores indicates the system is overloaded. Install htop with sudo apt install htop or sudo yum install htop.