Skip to content

How to List and Find Running Processes in Linux (ps, top)

Updated 6 min read

Updated: 12 October 2026 · Applies to: procps-ng 4.0.4 (ps, top, pgrep), htop 3.4.1, psmisc 23.7 and systemd 257 on Debian 13, tested; Ubuntu 24.04 and 26.04 ship the same procps-ng 4.0.4; ps, pgrep and htop 3.3.0 (EPEL) on AlmaLinux 10

To list all running processes in Linux, run ps aux. It shows every process with its user, process ID (PID), CPU and memory use and the command. For a live view that keeps the busiest processes at the top, run top (or htop). To find a process by name, run pgrep -a name.

ps aux                  # every process: user, PID, CPU %, memory %, command
ps -ef                  # every process with its parent process ID (PPID)
top                     # live view, press q to quit
pgrep -a nginx          # find processes by name
systemctl list-units --type=service --state=running   # running services

The output below is a lab example from a Debian 13 test container, so it shows only a few processes. A real server usually lists many more, including kernel threads, whose names are shown in square brackets. ps -e --no-headers | wc -l counts them.

1. List all processes with ps

$ ps aux
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.1  0.3  21676 12672 ?        Ss   03:25   0:00 /sbin/init
root         342  0.1  0.2  34444  8764 ?        Ss   03:26   0:00 /usr/lib/systemd/systemd-journald
root         363  0.0  0.0   4288  2432 ?        Ss   03:26   0:00 /usr/sbin/cron -f
root         380  0.4  0.2  14460  8448 ?        Ss   03:27   0:00 /usr/bin/python3 -c import time; time.sleep(3600)
alice        383  0.0  0.0   2580  1408 ?        S    03:27   0:00 sleep 1000
root         392  0.0  0.0   6392  3584 ?        R    03:27   0:00 ps aux

RSS is the physical memory (RAM) the process uses, in KiB. START is when it started and TIME the CPU time it has used. ps -ef lists the same processes in the other common format, with the parent PID, which tells you which process started which.

Running or sleeping? The STAT column shows the state. According to the ps manual, R is running or runnable, S is sleeping (waiting for an event), D is uninterruptible sleep (usually disk I/O), T is stopped and Z is a zombie. On a healthy server almost every process is S: it exists and works, but is waiting for something. To list only the processes that are on the CPU right now, add r. In our test that was just ps itself:

$ ps aux r
USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         395  0.0  0.0   6392  3712 ?        R    03:27   0:00 ps aux r

Sort and filter the list:

ps aux --sort=-%mem | head       # most memory first
ps aux --sort=-%cpu | head       # most CPU first
ps -u alice -o pid,etime,cmd     # only the processes of user alice

Pick your own columns with -o. ELAPSED (etime) is how long each process has been running:

$ ps -eo pid,user,%cpu,%mem,etime,cmd --sort=-%cpu | head -4
    PID USER     %CPU %MEM     ELAPSED CMD
    380 root      0.4  0.2       00:02 /usr/bin/python3 -c import time; time.sleep(3600)
    342 root      0.1  0.2       00:37 /usr/lib/systemd/systemd-journald
      1 root      0.1  0.3       01:33 /sbin/init

More ways to find the heaviest processes: Find Top Running Processes by Highest Memory and CPU Usage in Linux.

2. Watch processes live with top

top refreshes every few seconds. Its header shows the totals, for example Tasks: 8 total, 1 running, 7 sleeping, 0 stopped, 0 zombie. Keys you will use most (from the top manual):

  • P: sort by CPU, M: sort by memory, T: sort by CPU time.
  • u: show one user's processes; c: show the full command line.
  • 1: show each CPU separately.
  • k: kill a process (top asks for the PID and the signal); q: quit.

For a one-time snapshot you can save or paste into a support ticket, use batch mode:

$ top -b -n 1 | head -14
top - 03:27:37 up 12 days, 20:58,  0 users,  load average: 1.37, 0.94, 1.00
Tasks:   8 total,   1 running,   7 sleeping,   0 stopped,   0 zombie
(CPU and memory lines and the last two processes left out)
    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND
      1 root      20   0   21676  12672  10112 S   0.0   0.3   0:00.10 systemd
    342 root      20   0   34444   8764   7740 S   0.0   0.2   0:00.04 systemd-journal
    363 root      20   0    4288   2432   2304 S   0.0   0.1   0:00.00 cron
    380 root      20   0   14460   8448   5760 S   0.0   0.2   0:00.01 python3
    383 alice     20   0    2580   1408   1408 S   0.0   0.0   0:00.00 sleep

top -u alice shows one user and top -p 380 one process. More batch-mode examples: How to find top 15 Processes by Memory Usage with top in Batch Mode?

3. An easier live view: htop

sudo apt install htop                                     # Debian, Ubuntu
sudo dnf install epel-release && sudo dnf install htop  # AlmaLinux, Rocky Linux (htop is in EPEL)

htop shows CPU and memory bars and lets you scroll through the list with the arrow keys. According to the htop manual: F3 or / searches, F4 or \ filters the list, F5 or t shows a tree, F6 picks the sort column, u shows one user, F9 or k sends a signal (kill) and F10 or q quits. M and P sort by memory and CPU, as in top.

4. Find a process by name

$ pgrep python3                 # PIDs only
380
$ pgrep -a python3              # PIDs with the full command
380 /usr/bin/python3 -c import time; time.sleep(3600)
$ pgrep -a -u alice             # everything user alice runs
383 sleep 1000
$ pgrep -c sleep                # how many match
1
$ pidof cron                    # PIDs of an exact program name
363

When nothing matches, pgrep prints nothing and returns exit code 1, which is handy in scripts. If you use grep, put the first letter in brackets so the grep command does not find itself: ps aux | grep '[p]ython3' showed only the Python process, while ps aux | grep python3 also listed grep python3.

Related guides: get a process name from a PID, or a PID from a name, and How to Find Which Process Is Using a Port in Linux (ss, lsof, fuser).

5. Show which process started which

$ pstree -p
systemd(1)-+-cron(363)
           |-python3(380)
           |-sleep(383)
           `-systemd-journal(342)

pstree is in the psmisc package. Without it, ps -ef --forest draws the same tree.

6. List running services

Most server software (web server, database, mail) runs as a systemd service. List the ones that are running:

$ systemctl list-units --type=service --state=running
  UNIT                     LOAD   ACTIVE SUB     DESCRIPTION
  cron.service             loaded active running Regular background program processing daemon
  report-worker.service    loaded active running Report worker
  systemd-journald.service loaded active running Journal Service
(legend shortened)
3 loaded units listed.

systemctl status report-worker shows a service's state and its Main PID (380 here), and systemctl show -P MainPID report-worker prints just the PID.

7. Stop a process

kill 380                  # ask process 380 to stop (SIGTERM)
kill -9 380               # force it (SIGKILL), only if it does not stop
pkill -f "python3 -c"     # by name or part of the command line

For a service, use systemctl stop or systemctl restart instead of kill, so systemd knows the service was stopped on purpose (a service set to restart automatically would otherwise come back). Details: How to Find and Kill Running Processes in Linux?

More ps options: ps command switches and usages and 30 useful ps command examples. For CPU and memory totals, see How to Check CPU Usage on Linux: top, htop, mpstat and sar and How to Check Memory Usage in Linux (free, top, meminfo). If your Ucartz server is busy and you cannot tell why, attach the output of top -b -n 1 to a support ticket.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Unmanaged dedicated servers

full root access and free IPMI KVM, with Free Basic Managed Support.

Linux server management

hardening, patching, monitoring and automation for Ubuntu, Debian, RHEL and AlmaLinux.

Was this answer helpful?

Still stuck? Open a ticket