Gaming industry under DDoS attack. Get DDoS protection now. Start onboarding
  1. Home
  2. Developers
  3. How to List Running Processes in Linux

How to List Running Processes in Linux

  • By Gcore
  • September 15, 2023
  • 2 min read
How to List Running Processes in Linux

In the complex ecosystem of a Linux system, understanding the processes that run in the background is crucial for effective system management and troubleshooting. Whether you’re a system administrator wanting to monitor system health, or an everyday user curious about what’s running under the hood, this guide will walk you through the different methods for listing running processes on Linux. With practical steps and useful tips, we’ll help you gain a comprehensive view of your system’s activity.

Benefits of Viewing Running Processes in Linux

Running processes in Linux underpins the functionality of the operating system and offers various advantages. Here are five key benefits

  1. Multitasking Capability. Linux allows multiple processes to run concurrently. This means that a user can simultaneously execute various applications, such as browsing the web while listening to music, without causing interference between them.
  2. Resource Efficiency. Linux efficiently allocates system resources among running processes. The OS employs sophisticated scheduling algorithms to ensure that high-priority tasks receive more CPU time, while lower-priority tasks don’t hog resources.
  3. Process Isolation. Each process in Linux operates within its own memory space, which means that one process cannot directly interfere with or crash another. This enhances system stability and security.
  4. Fine-grained Control. With tools like ps, top, and htop, Linux users and administrators can monitor, prioritize, or even terminate processes. This provides a high level of control over system resources and application behavior.
  5. Flexibility for Developers. Linux provides a rich set of system calls and tools for process management. Developers can spawn, control, and terminate processes programmatically, leading to the development of robust and efficient applications and services.

How to View Running Processes in Linux

Let’s delve into the process of viewing running tasks on a Linux system. Here’s the guide below:

#1 Open the Terminal

Open your terminal by either searching for “Terminal” from the application menu or pressing Ctrl + Alt + T simultaneously.

#2 Use the ps Command

This command provides information about the currently running processes:

ps

This command, by default, will display processes running in the current shell. To view all the processes:

ps aux

For aux:

  • a. lists processes from all users
  • u. displays the process’s user/owner.
  • x. lists processes not attached to a terminal.

Sample Output:

#3 Use the top Command

This command provides a dynamic, real-time view of running processes.

top

You’ll see an interactive screen that refreshes periodically. This tool lists processes in descending order of CPU usage.

Sample Output:

#4 Use the htop Command

htop is an enhanced version of top with a more user-friendly interface and added features. It might not be pre-installed on all Linux distributions. To install, run this command.

sudo apt-get install htop   # For Debian-based systems like Ubuntusudo yum install htop       # For RedHat-based systems like CentOS

Then, run this command below.

htop

 #5 Search for a Specific Process

If you want to find a specific process, you can use grep along with ps:

ps aux | grep [process-name]

Replace [process-name] with the name or part of the name of the process you’re searching for. After you’ve completed your tasks, you can now close the terminal.

Well done! You can now successfully view running processes in Linux. This guide has provided you with a basic grasp of this capability. However, remember that Linux offers a variety of other advanced tools and commands for those seeking more detailed insights and greater control over system processes.

Conclusion

Looking to deploy Linux in the cloud? With Gcore Cloud, you can choose from Basic VM, Virtual Instances, or VPS/VDS suitable for Linux:

Choose an instance

Related articles

What's the difference between multi-cloud and hybrid cloud?

Multi-cloud and hybrid cloud represent two distinct approaches to distributed computing architecture that build upon the foundation of cloud computing to help organizations improve their IT infrastructure.Multi-cloud environments involve us

What is multi-cloud? Strategy, benefits, and best practices

Multi-cloud is a cloud usage model where an organization utilizes public cloud services from two or more cloud service providers, often combining public, private, and hybrid clouds, as well as different service models, such as Infrastructur

What is cloud migration? Benefits, strategy, and best practices

Cloud migration is the process of transferring digital assets, such as data, applications, and IT resources, from on-premises data centers to cloud platforms, including public, private, hybrid, or multi-cloud environments. Organizations can

What is a private cloud? Benefits, use cases, and implementation

A private cloud is a cloud computing environment dedicated exclusively to a single organization, providing a single-tenant infrastructure that improves security, control, and customization compared to public clouds.Private cloud environment

What is a cloud GPU? Definition, types, and benefits

A cloud GPU is a remotely rented graphics processing unit hosted in a cloud provider's data center, accessible over the internet via APIs or virtual machines. These virtualized resources allow users to access powerful computing capabilities

What is cloud networking: benefits, components, and implementation strategies

Cloud networking is the use and management of network resources, including hardware and software, hosted on public or private cloud infrastructures rather than on-premises equipment. Over 90% of enterprises are expected to adopt cloud netwo

Subscribe to our newsletter

Get the latest industry trends, exclusive insights, and Gcore updates delivered straight to your inbox.