List Running Processes in Linux

Introduction to Listing Programs in Linux and How They Work

On your Linux system, each application you use and each command you issue starts a task or process. To maintain the best system performance How to List Running Processes in Linux? you will need to control processes as a system administrator.

For more resources and guides like this, Visit and Subscribe to our Blog.

This lesson will go through various Linux commands you may use to manage and list active processes.

  • A Linux-running computer
  • A username with root or sudo rights
  • Access to the command line and terminal window

Overview of List Running Processes in Linux

The carrying out of a program is a procedure. They can be started when an application is opened or when a command is entered into the command-line terminal. For certain tasks, a program can, however, execute numerous processes. For instance, each time a new tab is opened in Google Chrome, a fresh process will launch.

How to List Running Processes in Linux? A procedure can start in the foreground or the background. Linux processes are each given a distinct PID (process identification number).

Processes may occasionally use a lot of resources and need to be terminated. Alternatively, there may be occasions when you want to raise a process priority level to force the system to give it additional resources. In any event, to complete any of these activities, you must list the Linux processes that are now active.

How to List Running Processes in Linux?

Use one of the three commands: ps, top, or htop to list processes in Linux. While the top and htop sort by CPU utilization, the PS tool delivers a static snapshot of all processes.

List Running Processes in Linux

How to List Running Processes in Linux? Let’s explore each of them in more detail.

Making use of the “ps” Command

All active processes are captured in a snapshot using the ps (process statuses) tool. Consequently, the outcomes are fixed, unlike the Windows task manager.

The PID, terminal name (TTY), running time (TIME), and the name of the command that launched the process are the four key columns that are returned when this command is used without any additional arguments or options (CMD). To learn more specific details about your active processes, utilize ps aux. The details of each defense are as follows:

  1. An option displays a list of all users active processes.
  2. U option offers extra details including the proportion of memory and CPU utilization, the process state code, and the owner of the processes.
  3. All processes not started from the terminal are listed using the x option. Daemons, which are system-related processes that run in the background as the system boots up, are a prime illustration of this.

Use the ps -axjf command to list Linux processes hierarchically. The shell will arrange procedures so that children come before parents in this fashion.

Boost Your Site’s Performance with VPS Hosting – Best Plans Available

Unlock the Potential of VPS Hosting – Starter Plan starts at just $12.50/month

Here are some additional typical instances of the ps command that lists active processes in Linux aside from those two choices:

  1. Ps -u [username] displays a list of all active processes for that user.
  2. Active Linux processes are displayed using the UNIX-style ps -e or ps -A commands.
  3. ps -T displays information about running processes from the terminal.
  4. The list will be filtered by the process name using Ps -C process name. This command also displays all offspring of the specified process.

Related Article: Different Between Linux Server vs Windows Server

Making use of the “top” Command

The top command is used to identify processes that are resource-hungry. The process that uses the most resources will be at the top of the list after this Linux program sorts it by CPU utilization. Checking to see if a certain process is active is also helpful.

Making use of the "top" Command

The output of the top command is updated on a regular basis, unlike the ps command. This implies that the CPU utilization and operating time will be updated in real-time. The following keys can be used to interact with the list after the shell returns it:

KeysFunctions
kKills a process
MSorts the list by memory usage.
NSorts the list by PID.
rChanges the priority of a process.
hDisplays the help window.
zDisplays running processes in colors.
dChanges the refresh time interval.
cDisplays the absolute path of a process.
CTRL+C;or;qStops the top command.

How to List Running Processes in Linux? Be careful not to enable the caps lock because the keys above are case-sensitive.

Running “htop” Command

When showing your Linux processes, both the htop and top commands provide identical information, but the former has more user-friendly features that are useful for regular process management.

First things first, you can scroll both vertically and horizontally with the htop command. As a result, you may view a complete list of all of your Linux processes as well as their whole command lines.

Additionally, the command enables you to pick items with the mouse, kill processes without entering their PIDs, quickly adjust the priority of numerous processes, and more. See our other article Ethtool Command Change Speed Duplex Linux to get better speed.

Running “htop” Command

Unfortunately, you must manually install this command because the majority of Linux distributions don’t include it.

Run the following command to install htop if you use Ubuntu:

  • Installing htop using sudo apt-get

Once it is installed, you may type htop to view a list of all the Linux processes. The htop command also offers a number of keyboard shortcuts, similar to the prior command:

KeysFunctions
F9To kill a process.
F8Increase the priority of a process.
F7Decrease the priority of a process.
F6Sort processes by any column.
F5Display processes in a tree view.
F4Filter the processes by name.
F3Search for a process.
F2Open the htop setup.
F1Display the help menu.

Using the command “atop”

A tool for keeping an eye on system resources in Linux is the topping command. It is a full-screen ASCII performance tool that records and summarizes information about all server processes.

Launch Your Own Hosting Business—Sign Up Now!

Start Reselling Hosting with Confidence – Economy Plan starts at $12.99/-

Atop will display the resource utilization for the CPU, RAM, swap, discs, and network in 10-second intervals after it has been run. Atop will continue to run in the background to do ongoing server analysis (up to 28 days by default).

Using the command "atop"

Want to use Tar Command? See our detailed Article on Tar Command in Linux: A Complete Guide.

Several benefits are as follows:

  1. Gathers resource-use data for all users and processes with the same name.
  2. Highlights in color the most important resources (red).
  3. Displays resource utilization across all processes, even those that have finished or been closed.
  4. Threads inside processes are observed (except for unused ones).
  5. To keep track of TCP, UDP, and network bandwidth, use netatop kernel mobile.

Either of the following commands will allow you to install the above command:

Ubuntu/Debian

  • sudo apt install atop

CentOS/RHEL/Fedora

  • sudo dnf install atop

Run the above command after installation to see all the processes that are using the system’s resources.

The list of possible arguments is shown below, along with brief summaries of each:

CommandDescription
man atopDisplays the top command manual page.
atop -lDisplays the average-per-second total values.
atop -aDisplays the active processes during the last intervals.
atop -cDisplays the command line per process.
atop -mDisplays the memory-related information.
atop -dDisplays the disk-related information.
atop -nDisplays the network information.
atop -sDisplays the scheduling details.
atop -vDisplays the various info (for example PPID, user, or time).
atop -yDisplays the individual threads.

To sort processes once the above is running, press one of the shortcut keys mentioned below:

KeysFunctions
aSorts in order of the most active resources.
cReverts to sorting by the CPU consumption (default).
dSorts in order of disk activity.
mSorts in order of memory usage.
nSorts in order of network activity.

Conclusion

Understanding how to list every process that is active on your Linux operating system is essential. When managing processes How to List Running Processes in Linux? the information will be helpful. What command do you like most out of the three? Post your comments in the space provided below!

For the Most Powerful and Scalable Hosting Services, Visit us at ARZ Host.

Read More:

Table of Content