Top Command in Termux – Monitor Running Processes in Real Time

“top” is a useful Linux command for checking system activity from the Termux terminal. It displays running processes along with CPU and memory usage in real time. You can use it to monitor resource usage, find processes using more CPU or memory, and understand what is running in the background on your Android device.

Here’s what you can do with the top command:

  • View running processes.
  • Monitor CPU usage.
  • Check memory usage.
  • See process IDs (PIDs).
  • Check which processes are using more resources.
  • Monitor system activity in real time.
  • Refresh the process list automatically.

Install Top in Termux

In most Termux installations, top is already available. You can check it with:

top

If the command is not available, install the required package:

pkg install procps -y

Then run:

top

Usage Guide

Run top to start monitoring processes.

top

The screen will continuously update and show information about running processes.

To exit top, press:

q

You can also press:

Ctrl + C

to stop the command.

Run top with a specific refresh delay:

top -d 2

This refreshes the information every 2 seconds.

To show a specific number of updates and then exit, you can use:

top -n 5

You can combine options:

top -d 2 -n 5

This updates the display every 2 seconds and stops after 5 updates.

You can also check the available options:

top --help

Understanding the Top Screen

When you run top, you will see different system information:

  • Tasks — Shows how many processes are running or sleeping.
  • Mem — Shows total, used, and free RAM.
  • Swap — Shows total, used, and free swap memory.
  • CPU — Shows CPU usage and idle time.
  • PID — Shows the ID of each process.
  • USER — Shows the user running the process.
  • PR — Shows the process priority.
  • VIRT — Shows the virtual memory used by a process.
  • RES — Shows the physical RAM used by a process.
  • SHR — Shows shared memory used by a process.
  • S — Shows the process status. R means running and S means sleeping.
  • %CPU — Shows how much CPU a process is using.
  • %MEM — Shows how much RAM a process is using.
  • TIME+ — Shows the CPU time used by the process.
  • COMMAND — Shows the name of the process.

The top command updates the information automatically, so you can watch CPU, RAM, swap, and running processes in real time.

End Note

The “top” command is a simple way to check running processes and system resource usage in Termux. It shows live CPU and memory usage in the terminal and helps you quickly see which processes are using system resources.

SHARE THIS POST: