How to check running process in Unix using command line

I am a new sysadmin for the Unix operating system. How do I check running process in Unix using the command line option?

One can use the Unix command line or terminal app to display a running process, change their priorities level, delete process and more. This page shows how to use various commands to list, kill and manage process on Unix.

Check running process in Unix

The procedure to monitor the running process in Unix using the command line is as follows:

  1. Open the terminal window on Unix
  2. For remote Unix server use the ssh command for log in purpose
  3. Type the ps aux command to see all running process in Unix
  4. Alternatively, you can issue the top command to view running process in Unix

How to manage processes from the Unix terminal

The ps command is a traditional Unix command to lists running processes. The following command shows all processes running on your system:
ps -aux
sudo ps -a

The process ID (PID) is essential to kill or control process on Unix. For example consider the following outputs:

vivek 43126  0.0  0.0 13160 8452  -  S    10:59   0:00.03 vim


  1. vivek – User name
  2. 43126 – PID (Unix process ID)
  3. 10:59 – Process start time
  4. vim – Actual process or command

There may be too many processes. Hence, it uses the following less command/more command as pipe to display process one screen at a time:
ps -aux | more
sudo ps -aux | less

Press q to exit from above Unix pagers. You can search for a particular Unix process using grep command/egrep command:
ps aux | grep nginx
sudo ps aux | grep vim
sudo ps -aux | egrep 'sshd|openvpn'

pgrep command

Many variants of Unix comes with the pgrep command to search/find process. The syntax is:
pgrep process
sudo pgrep sshd
pgrep vim
pgrep -l nginx

The -l option passed to the pgrep command to display long format and process name too.

top command

The top command is another highly recommended method to see your Unix servers resource usage. One can see a list of top process that using the most memory or CPU or disk.
sudo top
sudo top [options]

Unix kill command

Want to kill a process? Try kill command. The syntax is:
kill pid
kill -signal pid

Find PID using ps, pgrep or top command. Say you want to kill a PID # 50797, run:
kill 50797
For some reason if the process can not be killed, try forceful killing:
kill -9 50797
kill -KILL 50797

pkill command

If you wish to kill a process by name, try pkill command. The syntax is:
pkill processName
pkill vim
pkill firefox
pkill -9 emacs
sudo pkill -KILL php7-fpm

killall command

The killall command kills processes by name, as opposed to the selection by PID as done by kill command:
killall vim
killall -9 emacs

nice and renice command

The primary purpose of the nice command is to run a process/command at a lower or higher priority. Use the renice command to alter the nice value of one or more running Unix processes. The nice value can range from -20 to 19, with 19 being the lowest priority. Say, you want to compile software on a busy Unix server. You can set a very low priority, enter:
nice -n 13 cc -c *.c &
Set a very high priority for a kernel update. Before rebooting Unix server, run:

nice --10 wall <<end
System reboots in 5 minutes for Unix kernel update! 
Save all your work!!!
-- Sysadmin

To change the priority of a running process, type the following:
renice {Priority} -p {PID}
renice {Priority} {PID}
pgrep vim
renice 10 69947
sudo renice -10 $(pgrep vim)


This page shows how to manage the process on the Unix terminal. For further info see man pages or our example pages:

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

🐧 1 comment so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig 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
1 comment… add one
  • Dr. Grep May 1, 2018 @ 6:25

    I always used on my OpenBSD and FreeBSD unix servers:

    Be careful about the killall on Oracle/Sun Solaris Unix box ;)

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum