Let's think about it this way for a second
A process is simply a program that's currently running — each one gets assigned a number called a PID (Process ID). Running ps aux shows a snapshot (a photo taken at one moment in time) of every process running on the system — the columns include things like PID, %CPU, %MEM, and COMMAND. top, on the other hand, isn't a snapshot — it's a command that shows a live, real-time update, with the process eating up the most CPU/memory shown at the top; you exit it by pressing q. htop is basically an upgraded version of top — with color, scrolling, and mouse clicks, it's much easier to use (though you'll need to install it, since it's not there by default).
Let's connect this to a real-world scenario
If you get the feeling 'the server is acting sluggish,' open top and check the %CPU column — if a process at the top is hogging a ton of resources, that's likely the source of the problem. Running ps aux | grep nginx will catch every process belonging to the nginx web server — this is another real-world scenario where you'll run into pipes again. If you want to install htop, use sudo apt install htop (we'll cover package management in more depth in the next chapter).
Let's try it together in the terminal
ps aux
ps aux | grep nginx
top # q နှိပ်ပြီးထွက်
htop # install: sudo apt install htopRunning ps aux produces a table with PID, USER, %CPU, %MEM, and COMMAND columns.5-minute try-it
Run top and try it out. Note down which two processes are eating the most CPU/memory, then exit with q.
A quick word of caution
You can kill a process right from inside top/htop with the 'k' key, but as a beginner, be careful not to accidentally kill a system process from there — we'll cover kill in detail in a later chapter.