Check running process in linux for a user

Everything that is running on a Linux system – a service, script, or anything else – is considered a “process.” One of the core activities of a system administrator is that of monitoring and interacting with the processes running on a machine.

There are numerous command line methods that can be used in order to make it easier to check for certain processes. One such method is to check for processes that are running under a particular user.

As sever optimal use/maximization continues to grow, it becomes more and more important to manage processes well. In this tutorial, you will see a few different commands that can be used to check for running processes under a particular user in Linux.

In this tutorial you will learn:

  • How to use ps command to list processes by user
  • How to interpret ps output, and more command switches
  • How to use top and htop commands to list processes by user
  • How to install htop on major Linux distros
Check running process in Linux for a user
Check running process in Linux for a user
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Any Linux system
Software ps, top, htop
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Check running process in Linux for a user




As usual with all things on a Linux system, there is more than one way to accomplish the task we need to do. Check out some of the various commands below to see how to check for the processes running under a user.

ps command – list processes by user

The ps command is a default command line utility that can give us insight into the processes that are currently running on a Linux system. It can give us a lot of helpful information about these processes, including their PID (process ID), TTY, the user running a command or application, and more.

Normally, we would use the ps command with the following syntax:

$ ps aux
Output of the ps aux command on Linux
Output of the ps aux command on Linux

As you can see, there are quite a few columns in our output, and some of them may be cryptic to beginners. Let’s go over what each one means:

  • USER – The user who the process is running under.
  • PID – The process ID (every process is assigned a number as an ID).
  • %CPU – How much CPU percentage the process is utilizing.
  • %MEM – How much RAM percentage the process is utilizing.
  • VSZ – Virtual memory size of the process.
  • RSS – The physical memory size that the process is using.
  • TTY – Which TTY (terminal screen) the process is tied to, or ? for none.
  • STAT – The state code of the process; there are many but some common ones are S (sleeping) and R (running).
  • START – The time when the process started.
  • TIME – The accumulated CPU time the process has used.
  • COMMAND – The full command that was used to spawn the running process.

However, we want to isolate only the processes owned by a certain user. In this case, we will append the -U option and the name of the user whose processes we want to monitor. In this example, we will check for all the processes running under the root user.

$ ps -U root
Output showing only the processes running under the root user account
Output showing only the processes running under the root user account

This is good, but if we want to see more information about the processes running, we can append another u option. Furthermore, using -u will allow us to specify the user’s real and effective user ID. The syntax for our ps command now looks like this

$ ps -U root -u root u

As you can see from the screenshot, we get more detailed information about all the processes running under the root user.

ps command showing detailed information about all the processes running under the root account
ps command showing detailed information about all the processes running under the root account

top and htop commands – list processes by user




The top and htop commands can also be used to view all of the processes on our Linux system, as well as to see which user owns a process.

$ top

In the screenshot below, we can quickly see which processes are running under root and how many system resources they are consuming.

Output of the top command on Linux
Output of the top command on Linux

The htop command (a more human readable form of the aforementioned command) is even more helpful because we can simply click on the USER column to organize all the processes by each user.

Output of the htop command, with only processes for root user shown
Output of the htop command, with only processes for root user shown

In case you do not already have access to the htop command on your system, uou can use the appropriate command below to install htop with your system’s package manager.

To install htop on Ubuntu, Debian, and Linux Mint:

$ sudo apt install htop




To install htop on Fedora, CentOS, AlmaLinux, and Red Hat:

$ sudo dnf install htop

To install htop on Arch Linux and Manjaro:

$ sudo pacman -S htop

More help and examples

We have more guides dedicated to managing running processes, in case you are interested. We recommend the following:

Closing Thoughts




In this tutorial, we saw how to list the running processes on a Linux system by user. As usual with all things on a Linux system, there is more than one way to accomplish this task, such as with the ps, top, and htop commands seen in this tutorial.



Comments and Discussions
Linux Forum