Linux list processes by user names (EUID and RUID)

I am a new Linux system user. I want to list processes by user names on Linux. How can I show all the processes by a specific username using Linux command line options?

Introduction – A Linux process is nothing but running instance of a program. For example, when you start Firefox to browse Internet, you can create a new process. In Linux, each process is given a unique number called as a process identification (PID). Linux kernel makes sure that each process gets a unique PID. /sbin/init or /lib/systemd/systemd on modern Linux distros always has a PID of 1 because it is eternally the first process on the Linux based system. The ps command used to list the currently running processes and their PIDs on Linux.

Linux list processes by user names

The procedure to view process created by the specific user in Linux is as follows:

  1. Open the terminal window or app
  2. To see only the processes owned by a specific user on Linux run: ps -u {USERNAME}
  3. Search for a Linux process by name run: pgrep -u {USERNAME} {processName}
  4. Another option to list processes by name is to run either top -U {userName} or htop -u {userName} commands

Let us see examples in details to show all processes for a specific user on Linux.

How to see process created by a specific user in Linux

See all process crated by user named tom:
ps -u tom
ps -U tom
EUID is the Effective User ID. The effective user ID describes the user whose file access permissions are used by the process. RUID is the Real User ID. The real user ID identifies the user who created the process. So:

  • -u tom : Show all processes by RUID
  • -U tom : Display all processes by EUID

You can get a list of every process running as vivek (real [RUID] & effective ID [EUID]) in user format:
ps -U vivek -u vivek
ps -U vivek -u vivek u
## see all process run by, qemu and postfix users ##
ps -U qemu -u qemu
ps -U postfix -u postfix
ps -U postfix -u postfix u

How to show all processes for a specific user using top/htop

The syntax is pretty simple to see all processes created by a user named vivek:
top -U vivek

Linux list processes by user name using top command

My favorite command to check what user is running a process:
htop -u vivek

Linux show all processes created and used by a user named ‘vivek’ using htop

How to display user ID associated with a process

Another option is to use the combination of ps command and grep command/egrep command:
sudo ps -ef | grep {userName}
sudo ps -efl | grep {userName}
sudo ps -efl | grep vivek
sudo ps -ef | grep nginx
sudo ps -efl | grep 'www-data'

The www-data user ID associated with a Linux process named lighttpd, nginx, and php-fpm.

To confirm user IDs run the cat command/egrep command/grep command or /etc/passwd as follows:
cat /etc/passwd
grep 'www-data' /etc/passwd

You can print process tree of user named www-data too, run the pstree command:
pstree [options] {userName}
pstree www-data
pstree -l -a -p -s vivek
pstree -laps www-dat

  • -l : Long format
  • -a : Show command line args
  • -p : Display Linux PIDs
  • -s : See parents of the selected process

The pgrep command

The pgrep command can look up processes based on usernames. The syntax is:
### Only match processes whose Linux effective user ID (euid) is listed ###
pgrep -u euid
### Only match processes whose effective user ID (uid) is listed ##
pgrep -U uid
pgrep -l -u vivek
pgrep -l -U www-data


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 5 comments so far... add one

CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
5 comments… add one
  • Rudra T Jan 13, 2014 @ 11:24

    I love:
    top -U [username]

    • Alexis Sep 21, 2016 @ 19:49

      ps -fu [username]

  • Laxmi "Lax" May 1, 2014 @ 2:03

    Linux or Unix, it just worked for me:

    ps -u [username]
    ps -u apache
    ps -u laxmi
    • Santino Oct 12, 2015 @ 13:27


      You forgot

      ps -aux | grep [username]
      ps -aux | grep --color -i "apache"

  • Azariah Q T Mar 30, 2018 @ 1:31


    Please update this page and include htop[1]:
    htop -u [username]


Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @