In Linux, monitoring running processes is a key part of system administration. The ps and top commands are the primary tools used to list active processes on the system. By default, they show processes for all users and groups, making it hard to focus on specific users or groups.

In many cases, administrators need to filter processes by user or group. This can be useful for troubleshooting or managing resources in multi-user environments. The ps, pgrep, and top commands can be used with specific options to list processes for individual users or groups.

These tools allow you to isolate processes based on real user IDs, usernames, group names, or group IDs. Learning how to use these commands effectively is essential for managing tasks on Linux systems, especially in shared environments.

Steps to list processes by user and group in Linux:

  1. Show processes for a single user using the ps command.
    $ ps -u user -U user
        PID TTY          TIME CMD
       1423 ?        00:00:00 systemd
       1424 ?        00:00:00 (sd-pam)
       1430 ?        00:00:00 pipewire
       1431 ?        00:00:00 pipewire-media-
       1432 ?        00:00:00 pulseaudio
       1434 ?        00:00:00 tracker-miner-f
       1437 ?        00:00:00 dbus-daemon
       1439 ?        00:00:00 gnome-keyring-d
       1459 ?        00:00:00 gvfsd
       1464 ?        00:00:00 gvfsd-fuse
       1466 ?        00:00:00 gvfs-udisks2-vo
       1477 ?        00:00:00 gvfs-goa-volume
       1482 ?        00:00:00 goa-daemon
       1492 ?        00:00:00 goa-identity-se
       1499 ?        00:00:00 gvfs-gphoto2-vo
       1503 ?        00:00:00 gvfs-mtp-volume
       1509 tty2     00:00:00 gdm-wayland-ses
       1511 ?        00:00:00 gvfs-afc-volume
       1517 tty2     00:00:00 gnome-session-b
       1568 ?        00:00:00 gnome-session-c
       1576 ?        00:00:00 gnome-session-b
       1593 ?        00:00:04 gnome-shell
       1597 ?        00:00:00 at-spi-bus-laun
       1605 ?        00:00:00 dbus-daemon
       1613 ?        00:00:00 Xwayland
       1634 ?        00:00:00 xdg-permission-
       1636 ?        00:00:00 gnome-shell-cal
       1645 ?        00:00:00 evolution-sourc
       1652 ?        00:00:00 evolution-calen
       1660 ?        00:00:00 dconf-service
       1664 ?        00:00:00 evolution-addre
       1682 ?        00:00:00 gjs
       1684 ?        00:00:00 at-spi2-registr
       1694 ?        00:00:00 gvfsd-trash
       1699 ?        00:00:00 gsd-a11y-settin
       1700 ?        00:00:00 gsd-color
       1702 ?        00:00:00 gsd-datetime
       1703 ?        00:00:00 gsd-housekeepin
       1705 ?        00:00:00 gsd-keyboard
       1719 ?        00:00:00 gsd-media-keys
       1722 ?        00:00:00 gsd-power
       1723 ?        00:00:00 gsd-print-notif
       1724 ?        00:00:00 gsd-rfkill
       1728 ?        00:00:00 gsd-screensaver
       1735 ?        00:00:00 gsd-sharing
       1736 ?        00:00:00 gsd-smartcard
       1752 ?        00:00:00 gsd-sound
       1754 ?        00:00:00 gsd-wacom
       1761 ?        00:00:00 gsd-disk-utilit
       1774 ?        00:00:00 evolution-alarm
       1778 ?        00:00:00 gsd-printer
       1781 ?        00:00:00 vmtoolsd
       1861 ?        00:00:00 ibus-daemon
       1862 ?        00:00:00 gsd-xsettings
       1885 ?        00:00:00 ibus-dconf
       1887 ?        00:00:00 ibus-extension-
       1889 ?        00:00:00 ibus-x11
       1900 ?        00:00:00 ibus-portal
       1919 ?        00:00:00 ibus-engine-sim
       1929 ?        00:00:00 gjs
       1960 ?        00:00:00 gnome-terminal-
       1962 ?        00:00:00 gnome-calendar
       1963 ?        00:00:00 gnome-control-c
       2184 pts/0    00:00:00 bash
       2213 ?        00:00:00 gvfsd-metadata
       2216 ?        00:00:00 update-notifier
       2240 pts/0    00:00:00 ps

    The -u option lists processes for a specific user by their username.

    -U      Display the processes belonging to the specified real user IDs.
    -u      Display the processes belonging to the specified usernames.

    user is a real user and group name in the system.

    $ id
    uid=1000(user) gid=1000(user) groups=1000(user),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),121(lpadmin),132(lxd),133(sambashare)
  2. Show processes for a single group using the ps command.
    $ ps -g user -G user
        PID TTY          TIME CMD
       1418 ?        00:00:00 gdm-session-wor
       1423 ?        00:00:00 systemd
       1424 ?        00:00:00 (sd-pam)
       1430 ?        00:00:00 pipewire
       1431 ?        00:00:00 pipewire-media-
       1432 ?        00:00:00 pulseaudio
       1434 ?        00:00:00 tracker-miner-f
       1437 ?        00:00:00 dbus-daemon
       1439 ?        00:00:00 gnome-keyring-d
       1459 ?        00:00:00 gvfsd
       1464 ?        00:00:00 gvfsd-fuse
       1466 ?        00:00:00 gvfs-udisks2-vo
       1477 ?        00:00:00 gvfs-goa-volume
       1482 ?        00:00:00 goa-daemon
       1492 ?        00:00:00 goa-identity-se
       1499 ?        00:00:00 gvfs-gphoto2-vo
       1503 ?        00:00:00 gvfs-mtp-volume
       1509 tty2     00:00:00 gdm-wayland-ses
       1511 ?        00:00:00 gvfs-afc-volume
       1517 tty2     00:00:00 gnome-session-b
       1568 ?        00:00:00 gnome-session-c
       1576 ?        00:00:00 gnome-session-b
       1593 ?        00:00:05 gnome-shell
       1597 ?        00:00:00 at-spi-bus-laun
       1605 ?        00:00:00 dbus-daemon
       1613 ?        00:00:00 Xwayland
       1634 ?        00:00:00 xdg-permission-
       1636 ?        00:00:00 gnome-shell-cal
       1645 ?        00:00:00 evolution-sourc
       1652 ?        00:00:00 evolution-calen
       1660 ?        00:00:00 dconf-service
       1664 ?        00:00:00 evolution-addre
       1682 ?        00:00:00 gjs
       1684 ?        00:00:00 at-spi2-registr
       1694 ?        00:00:00 gvfsd-trash
       1699 ?        00:00:00 gsd-a11y-settin
       1700 ?        00:00:00 gsd-color
       1702 ?        00:00:00 gsd-datetime
       1703 ?        00:00:00 gsd-housekeepin
       1705 ?        00:00:00 gsd-keyboard
       1719 ?        00:00:00 gsd-media-keys
       1722 ?        00:00:00 gsd-power
       1723 ?        00:00:00 gsd-print-notif
       1724 ?        00:00:00 gsd-rfkill
       1728 ?        00:00:00 gsd-screensaver
       1735 ?        00:00:00 gsd-sharing
       1736 ?        00:00:00 gsd-smartcard
       1752 ?        00:00:00 gsd-sound
       1754 ?        00:00:00 gsd-wacom
       1761 ?        00:00:00 gsd-disk-utilit
       1774 ?        00:00:00 evolution-alarm
       1778 ?        00:00:00 gsd-printer
       1781 ?        00:00:00 vmtoolsd
       1861 ?        00:00:00 ibus-daemon
       1862 ?        00:00:00 gsd-xsettings
       1885 ?        00:00:00 ibus-dconf
       1887 ?        00:00:00 ibus-extension-
       1889 ?        00:00:00 ibus-x11
       1900 ?        00:00:00 ibus-portal
       1919 ?        00:00:00 ibus-engine-sim
       1929 ?        00:00:00 gjs
       1960 ?        00:00:01 gnome-terminal-
       1962 ?        00:00:00 gnome-calendar
       2184 pts/0    00:00:00 bash
       2213 ?        00:00:00 gvfsd-metadata
       2216 ?        00:00:00 update-notifier
       2246 ?        00:00:00 deja-dup-monito
       2271 pts/0    00:00:00 ps

    The -g option lists processes based on the specified group name.

    -G      Display information about processes which are running with the specified real group IDs.
    -g      Display information about processes with the specified process group leaders.
  3. List processes for multiple users with the ps command.
    $ ps -u user,root -U user,root
        PID TTY          TIME CMD
          1 ?        00:00:02 systemd
          2 ?        00:00:00 kthreadd
          3 ?        00:00:00 rcu_gp
          4 ?        00:00:00 rcu_par_gp
          6 ?        00:00:00 kworker/0:0H-events_highpri
          7 ?        00:00:00 kworker/0:1-events
          8 ?        00:00:00 kworker/u256:0-ext4-rsv-conversion
          9 ?        00:00:00 mm_percpu_wq
         10 ?        00:00:00 rcu_tasks_rude_
         11 ?        00:00:00 rcu_tasks_trace
         12 ?        00:00:00 ksoftirqd/0
         13 ?        00:00:00 rcu_sched
         14 ?        00:00:00 migration/0
         15 ?        00:00:00 idle_inject/0
         16 ?        00:00:00 cpuhp/0
         17 ?        00:00:00 cpuhp/1
         18 ?        00:00:00 idle_inject/1
         19 ?        00:00:00 migration/1
         20 ?        00:00:00 ksoftirqd/1
         21 ?        00:00:00 kworker/1:0-events
         22 ?        00:00:00 kworker/1:0H-events_highpri
         23 ?        00:00:00 kdevtmpfs
         24 ?        00:00:00 netns
         25 ?        00:00:00 inet_frag_wq
         26 ?        00:00:00 kauditd
         27 ?        00:00:00 kworker/0:2-events
         28 ?        00:00:00 khungtaskd
         29 ?        00:00:00 oom_reaper
         30 ?        00:00:00 writeback
         31 ?        00:00:00 kcompactd0
         32 ?        00:00:00 ksmd
         33 ?        00:00:00 khugepaged
         37 ?        00:00:00 kworker/1:1-events
         80 ?        00:00:00 kintegrityd
         81 ?        00:00:00 kblockd
         82 ?        00:00:00 blkcg_punt_bio
         83 ?        00:00:00 tpm_dev_wq
         84 ?        00:00:00 ata_sff
         85 ?        00:00:00 md
         86 ?        00:00:00 edac-poller
         87 ?        00:00:00 devfreq_wq
         88 ?        00:00:00 watchdogd
         90 ?        00:00:00 kworker/0:1H-kblockd
         92 ?        00:00:00 kswapd0
         93 ?        00:00:00 ecryptfs-kthrea
         95 ?        00:00:00 kthrotld
         96 ?        00:00:00 irq/24-pciehp
         97 ?        00:00:00 irq/25-pciehp
         98 ?        00:00:00 irq/26-pciehp
         99 ?        00:00:00 irq/27-pciehp
        100 ?        00:00:00 irq/28-pciehp
        101 ?        00:00:00 irq/29-pciehp
        102 ?        00:00:00 irq/30-pciehp
        103 ?        00:00:00 irq/31-pciehp
        104 ?        00:00:00 irq/32-pciehp
        105 ?        00:00:00 irq/33-pciehp
        106 ?        00:00:00 irq/34-pciehp
        107 ?        00:00:00 irq/35-pciehp
        108 ?        00:00:00 irq/36-pciehp
        109 ?        00:00:00 irq/37-pciehp
        110 ?        00:00:00 irq/38-pciehp
        111 ?        00:00:00 irq/39-pciehp
        112 ?        00:00:00 irq/40-pciehp
        113 ?        00:00:00 irq/41-pciehp
        114 ?        00:00:00 irq/42-pciehp
        115 ?        00:00:00 irq/43-pciehp
        116 ?        00:00:00 irq/44-pciehp
        117 ?        00:00:00 irq/45-pciehp
        118 ?        00:00:00 irq/46-pciehp
        119 ?        00:00:00 irq/47-pciehp
        120 ?        00:00:00 irq/48-pciehp
        121 ?        00:00:00 irq/49-pciehp
        122 ?        00:00:00 irq/50-pciehp
        123 ?        00:00:00 irq/51-pciehp
        124 ?        00:00:00 irq/52-pciehp
        125 ?        00:00:00 irq/53-pciehp
        126 ?        00:00:00 irq/54-pciehp
        127 ?        00:00:00 irq/55-pciehp
        128 ?        00:00:00 acpi_thermal_pm
        130 ?        00:00:00 scsi_eh_0
        131 ?        00:00:00 scsi_tmf_0
        132 ?        00:00:00 scsi_eh_1
        133 ?        00:00:00 scsi_tmf_1
        135 ?        00:00:00 vfio-irqfd-clea
        136 ?        00:00:00 kworker/1:1H-kblockd
        137 ?        00:00:00 ipv6_addrconf
        147 ?        00:00:00 kstrp
        150 ?        00:00:00 zswap-shrink
        151 ?        00:00:00 kworker/u257:0-hci0
        156 ?        00:00:00 charger_manager
        203 ?        00:00:00 mpt_poll_0
        204 ?        00:00:00 mpt/0
        205 ?        00:00:00 scsi_eh_2
        206 ?        00:00:00 scsi_tmf_2
        207 ?        00:00:00 scsi_eh_3
        208 ?        00:00:00 scsi_tmf_3
        209 ?        00:00:00 scsi_eh_4
        210 ?        00:00:00 scsi_tmf_4
        211 ?        00:00:00 scsi_eh_5
        212 ?        00:00:00 scsi_tmf_5
        213 ?        00:00:00 scsi_eh_6
        214 ?        00:00:00 scsi_tmf_6
        215 ?        00:00:00 scsi_eh_7
        217 ?        00:00:00 scsi_tmf_7
        218 ?        00:00:00 scsi_eh_8
        219 ?        00:00:00 scsi_tmf_8
        220 ?        00:00:00 scsi_eh_9
        221 ?        00:00:00 scsi_tmf_9
        222 ?        00:00:00 scsi_eh_10
        223 ?        00:00:00 scsi_tmf_10
        224 ?        00:00:00 scsi_eh_11
        225 ?        00:00:00 scsi_tmf_11
        226 ?        00:00:00 scsi_eh_12
        227 ?        00:00:00 scsi_tmf_12
        228 ?        00:00:00 scsi_eh_13
        229 ?        00:00:00 scsi_tmf_13
        230 ?        00:00:00 scsi_eh_14
        231 ?        00:00:00 scsi_tmf_14
        232 ?        00:00:00 scsi_eh_15
        233 ?        00:00:00 scsi_tmf_15
        234 ?        00:00:00 scsi_eh_16
        235 ?        00:00:00 scsi_tmf_16
        236 ?        00:00:00 scsi_eh_17
        237 ?        00:00:00 scsi_tmf_17
        238 ?        00:00:00 scsi_eh_18
        239 ?        00:00:00 scsi_tmf_18
        240 ?        00:00:00 scsi_eh_19
        241 ?        00:00:00 scsi_tmf_19
        242 ?        00:00:00 scsi_eh_20
        243 ?        00:00:00 scsi_tmf_20
        244 ?        00:00:00 scsi_eh_21
        245 ?        00:00:00 scsi_tmf_21
        246 ?        00:00:00 scsi_eh_22
        247 ?        00:00:00 scsi_tmf_22
        248 ?        00:00:00 scsi_eh_23
        249 ?        00:00:00 scsi_tmf_23
        250 ?        00:00:00 scsi_eh_24
        251 ?        00:00:00 scsi_tmf_24
        252 ?        00:00:00 scsi_eh_25
        253 ?        00:00:00 scsi_tmf_25
        254 ?        00:00:00 scsi_eh_26
        255 ?        00:00:00 scsi_tmf_26
        256 ?        00:00:00 scsi_eh_27
        257 ?        00:00:00 scsi_tmf_27
        258 ?        00:00:00 scsi_eh_28
        259 ?        00:00:00 scsi_tmf_28
        260 ?        00:00:00 scsi_eh_29
        261 ?        00:00:00 scsi_tmf_29
        262 ?        00:00:00 scsi_eh_30
        263 ?        00:00:00 scsi_tmf_30
        264 ?        00:00:00 scsi_eh_31
        265 ?        00:00:00 scsi_tmf_31
        289 ?        00:00:00 kworker/u256:28-events_unbound
        290 ?        00:00:00 kworker/u256:29-ext4-rsv-conversion
        291 ?        00:00:00 kworker/u256:30-events_unbound
        292 ?        00:00:00 scsi_eh_32
        293 ?        00:00:00 scsi_tmf_32
        316 ?        00:00:00 jbd2/sda3-8
        317 ?        00:00:00 ext4-rsv-conver
        356 ?        00:00:00 systemd-journal
        380 ?        00:00:00 kworker/0:3-rcu_par_gp
        385 ?        00:00:00 systemd-udevd
        386 ?        00:00:00 vmware-vmblock-
        389 ?        00:00:00 irq/16-vmwgfx
        390 ?        00:00:00 ttm_swap
        391 ?        00:00:00 card0-crtc0
        392 ?        00:00:00 card0-crtc1
        393 ?        00:00:00 card0-crtc2
        394 ?        00:00:00 card0-crtc3
        395 ?        00:00:00 card0-crtc4
        396 ?        00:00:00 card0-crtc5
        397 ?        00:00:00 card0-crtc6
        398 ?        00:00:00 card0-crtc7
        404 ?        00:00:00 loop0
        406 ?        00:00:00 loop1
        407 ?        00:00:00 loop2
        408 ?        00:00:00 loop3
        430 ?        00:00:00 loop4
        437 ?        00:00:00 loop5
        438 ?        00:00:00 loop6
        439 ?        00:00:00 loop7
        444 ?        00:00:00 loop8
        445 ?        00:00:00 loop9
        493 ?        00:00:00 kworker/u257:2-hci0
        521 ?        00:00:00 cryptd
        722 ?        00:00:00 VGAuthService
        728 ?        00:00:00 vmtoolsd
        742 ?        00:00:00 accounts-daemon
        743 ?        00:00:00 acpid
        744 ?        00:00:00 anacron
        747 ?        00:00:00 bluetoothd
        749 ?        00:00:00 cron
        754 ?        00:00:00 NetworkManager
        759 ?        00:00:00 irqbalance
        760 ?        00:00:00 networkd-dispat
        765 ?        00:00:00 polkitd
        769 ?        00:00:00 power-profiles-
        781 ?        00:00:01 snapd
        785 ?        00:00:00 switcheroo-cont
        788 ?        00:00:00 systemd-logind
        791 ?        00:00:00 udisksd
        794 ?        00:00:00 wpa_supplicant
        849 ?        00:00:00 ModemManager
        870 ?        00:00:00 unattended-upgr
        884 ?        00:00:00 gdm3
        897 ?        00:00:00 cupsd
        904 ?        00:00:00 cups-browsed
       1124 ?        00:00:00 upowerd
       1215 ?        00:00:00 packagekitd
       1418 ?        00:00:00 gdm-session-wor
       1423 ?        00:00:00 systemd
       1424 ?        00:00:00 (sd-pam)
       1430 ?        00:00:00 pipewire
       1431 ?        00:00:00 pipewire-media-
       1432 ?        00:00:00 pulseaudio
       1434 ?        00:00:00 tracker-miner-f
       1437 ?        00:00:00 dbus-daemon
       1439 ?        00:00:00 gnome-keyring-d
       1459 ?        00:00:00 gvfsd
       1464 ?        00:00:00 gvfsd-fuse
       1466 ?        00:00:00 gvfs-udisks2-vo
       1477 ?        00:00:00 gvfs-goa-volume
       1482 ?        00:00:00 goa-daemon
       1492 ?        00:00:00 goa-identity-se
       1494 ?        00:00:00 krfcommd
       1499 ?        00:00:00 gvfs-gphoto2-vo
       1503 ?        00:00:00 gvfs-mtp-volume
       1509 tty2     00:00:00 gdm-wayland-ses
       1511 ?        00:00:00 gvfs-afc-volume
       1517 tty2     00:00:00 gnome-session-b
       1568 ?        00:00:00 gnome-session-c
       1576 ?        00:00:00 gnome-session-b
       1593 ?        00:00:06 gnome-shell
       1597 ?        00:00:00 at-spi-bus-laun
       1605 ?        00:00:00 dbus-daemon
       1613 ?        00:00:00 Xwayland
       1634 ?        00:00:00 xdg-permission-
       1636 ?        00:00:00 gnome-shell-cal
       1645 ?        00:00:00 evolution-sourc
       1652 ?        00:00:00 evolution-calen
       1660 ?        00:00:00 dconf-service
       1664 ?        00:00:00 evolution-addre
       1682 ?        00:00:00 gjs
       1684 ?        00:00:00 at-spi2-registr
       1694 ?        00:00:00 gvfsd-trash
       1699 ?        00:00:00 gsd-a11y-settin
       1700 ?        00:00:00 gsd-color
       1702 ?        00:00:00 gsd-datetime
       1703 ?        00:00:00 gsd-housekeepin
       1705 ?        00:00:00 gsd-keyboard
       1719 ?        00:00:00 gsd-media-keys
       1722 ?        00:00:00 gsd-power
       1723 ?        00:00:00 gsd-print-notif
       1724 ?        00:00:00 gsd-rfkill
       1728 ?        00:00:00 gsd-screensaver
       1735 ?        00:00:00 gsd-sharing
       1736 ?        00:00:00 gsd-smartcard
       1752 ?        00:00:00 gsd-sound
       1754 ?        00:00:00 gsd-wacom
       1761 ?        00:00:00 gsd-disk-utilit
       1774 ?        00:00:00 evolution-alarm
       1778 ?        00:00:00 gsd-printer
       1781 ?        00:00:00 vmtoolsd
       1861 ?        00:00:00 ibus-daemon
       1862 ?        00:00:00 gsd-xsettings
       1885 ?        00:00:00 ibus-dconf
       1887 ?        00:00:00 ibus-extension-
       1889 ?        00:00:00 ibus-x11
       1900 ?        00:00:00 ibus-portal
       1919 ?        00:00:00 ibus-engine-sim
       1929 ?        00:00:00 gjs
       1960 ?        00:00:01 gnome-terminal-
       1962 ?        00:00:00 gnome-calendar
       2184 pts/0    00:00:00 bash
       2213 ?        00:00:00 gvfsd-metadata
       2216 ?        00:00:00 update-notifier
       2398 pts/0    00:00:00 ps

    All the example options (-u, -U, -g, -G) can be used for all the tools below.

  4. Filter the ps process list by user with the grep command.
    $ ps -aef | grep avahi
    avahi        746       1  0 07:06 ?        00:00:00 avahi-daemon: running [host.local]
    avahi        815     746  0 07:06 ?        00:00:00 avahi-daemon: chroot helper
    user        2403    2184  0 07:12 pts/0    00:00:00 grep --color=auto avahi

    The grep command filters process output based on keywords, such as a username.

  5. Show processes for a specific user using the top command.
    $ top -u user
    
    top - 07:12:59 up 6 min,  1 user,  load average: 0.01, 0.13, 0.09
    Tasks: 286 total,   1 running, 285 sleeping,   0 stopped,   0 zombie
    %Cpu0  :  0.0 us,  0.0 sy,  0.0 ni,100.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
    %Cpu1  : 33.3 us,  0.0 sy,  0.0 ni, 66.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
    MiB Mem :   3894.9 total,   2352.8 free,    866.0 used,    676.0 buff/cache
    MiB Swap:    923.2 total,    923.2 free,      0.0 used.   2781.2 avail Mem 
    
        PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND 
       1960 user      20   0  411896  50404  38024 S  33.3   1.3   0:02.06 gnome-+ 
       1423 user      20   0   16196   9704   7424 S   0.0   0.2   0:00.34 systemd 
       1424 user      20   0  102304   3620     24 S   0.0   0.1   0:00.00 (sd-pa+ 
       1430 user       9 -11   90940   5876   4776 S   0.0   0.1   0:00.02 pipewi+ 
       1431 user       9 -11   82964   5888   4872 S   0.0   0.1   0:00.02 pipewi+ 
       1432 user       9 -11 1491348  19356  14788 S   0.0   0.5   0:00.97 pulsea+ 
       1434 user      39  19  521388  24992  16768 S   0.0   0.6   0:00.08 tracke+ 
       1437 user      20   0    9536   6024   4276 S   0.0   0.2   0:00.30 dbus-d+ 
       1439 user      20   0  250204   7368   6428 S   0.0   0.2   0:00.05 gnome-+ 
       1459 user      20   0  249844   8316   7288 S   0.0   0.2   0:00.02 gvfsd   
       1464 user      20   0  379672   6776   6104 S   0.0   0.2   0:00.00 gvfsd-+ 
       1466 user      20   0  325104   9716   8304 S   0.0   0.2   0:00.02 gvfs-u+ 
       1477 user      20   0  245848   6576   6036 S   0.0   0.2   0:00.01 gvfs-g+ 
       1482 user      20   0  563824  41372  34748 S   0.0   1.0   0:00.04 goa-da+ 
       1492 user      20   0  324736   9100   8044 S   0.0   0.2   0:00.01 goa-id+ 
       1499 user      20   0  246732   6908   6188 S   0.0   0.2   0:00.00 gvfs-g+ 
       1503 user      20   0  245664   6548   5936 S   0.0   0.2   0:00.01 gvfs-m+ 
       1509 user      20   0  171612   6252   5724 S   0.0   0.2   0:00.00 gdm-wa+ 
       1511 user      20   0  322952   7748   6884 S   0.0   0.2   0:00.03 gvfs-a+ 
       1517 user      20   0  229916  15500  13832 S   0.0   0.4   0:00.02 gnome-+ 
       1568 user      20   0  100964   4912   4476 S   0.0   0.1   0:00.01 gnome-+ 

    The top command provides real-time monitoring of processes for a specific user.

    top accepts either -u or -U , but not both at the same time.

    $ top -u user -U user
    top: conflicting process selections (U/p/u)
  6. Display processes for multiple users using the pgrep command.
    $ pgrep -l -u user -U user
    1423 systemd
    1424 (sd-pam)
    1430 pipewire
    1431 pipewire-media-
    1432 pulseaudio
    1434 tracker-miner-f
    1437 dbus-daemon
    1439 gnome-keyring-d
    1459 gvfsd
    1464 gvfsd-fuse
    1466 gvfs-udisks2-vo
    1477 gvfs-goa-volume
    1482 goa-daemon
    1492 goa-identity-se
    1499 gvfs-gphoto2-vo
    1503 gvfs-mtp-volume
    1509 gdm-wayland-ses
    1511 gvfs-afc-volume
    1517 gnome-session-b
    1568 gnome-session-c
    1576 gnome-session-b
    1593 gnome-shell
    1597 at-spi-bus-laun
    1605 dbus-daemon
    1613 Xwayland
    1634 xdg-permission-
    1636 gnome-shell-cal
    1645 evolution-sourc
    1652 evolution-calen
    1660 dconf-service
    1664 evolution-addre
    1682 gjs
    1684 at-spi2-registr
    1694 gvfsd-trash
    1699 gsd-a11y-settin
    1700 gsd-color
    1702 gsd-datetime
    1703 gsd-housekeepin
    1705 gsd-keyboard
    1719 gsd-media-keys
    1722 gsd-power
    1723 gsd-print-notif
    1724 gsd-rfkill
    1728 gsd-screensaver
    1735 gsd-sharing
    1736 gsd-smartcard
    1752 gsd-sound
    1754 gsd-wacom
    1761 gsd-disk-utilit
    1774 evolution-alarm
    1778 gsd-printer
    1781 vmtoolsd
    1861 ibus-daemon
    1862 gsd-xsettings
    1885 ibus-dconf
    1887 ibus-extension-
    1889 ibus-x11
    1900 ibus-portal
    1919 ibus-engine-sim
    1929 gjs
    1960 gnome-terminal-
    1962 gnome-calendar
    2184 bash
    2213 gvfsd-metadata
    2216 update-notifier

    The pgrep command lists the process IDs (PIDs) for the given users.

Discuss the article:

Comment anonymously. Login not required.