• Contact
  • About Me
  • Privacy Policy
  • Disclaimer
DefenceDev
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
  • Web Tools
No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
  • Web Tools
No Result
View All Result
DefenceDev
No Result
View All Result
ADVERTISEMENT
Home Linux Tutorials Commands

Check Running Processes and Services in Linux via ps

neo by neo
September 11, 2025
in Commands
0
Linux Process, List all Running Services with ps Command

Linux Process, List all Running Services with ps Command

0
SHARES
26
VIEWS
Share on FacebookShare on LinkedIn
Table of Contents
  • List Running Services with ps Command
    • The ps Command
    • Listing All Running Services
  • Useful Examples
    • Listing All systemd Services
    • List all Processes Sorted by Memory Usage
    • Display Specific Columns (PID, User, Command)
    • Monitor the Memory Usage at Regular Intervals
  • Conclusion
    • Key Features

List Running Services with ps Command

In this article, we will see how to use the ps command to list all running services on Linux. In Linux, a process is an instance of a running program. Each process has a unique Process ID (PID) and can be in various states such as running, sleeping, or stopped. Services, on the other hand, are background processes that perform specific tasks, often started at boot time and managed by the system’s init system (like systemd or init).

You can check more details about ps command on the following link.

The ps Command

The ps (process status) command is used to display information about active processes. It provides a snapshot of the current processes, including details like PID, user, CPU usage, memory usage, and more.

Listing All Running Services

To list all running services using the ps command, you can use various options and filters. Here are some common usages:

Basic Usage

ps -e 
  • e: Shows all processes.

This command lists all processes running on the system.

Detailed Information

ps -ef 
  • e: Shows all processes.
  • f: Displays full-format listing.

The -f option provides a full-format listing, including additional details like the parent process ID (PPID) and the command that started the process.

Filtering by Service Name

ps -ef | grep <service_name> 

Replace <service_name> with the name of the service you want to filter. This command helps you find specific services.

Using ps with aux

ps aux 
  • a: Shows processes for all users.
  • u: Displays the user-oriented format.
  • x: Shows processes not attached to a terminal.

The aux options provide a detailed listing of all processes, including those not started by the current user.

Detailed Options

  • ps -A or ps -e: Show all processes.
  • ps -a: Show all processes except session leaders and processes not associated with a terminal.
  • ps -u [username]: Show processes for a specific user.
  • ps -p [pid]: Show information for a specific process ID.
  • ps --sort=[key]: Sort the output based on the specified key (e.g., %cpu, %mem, pid).
  • ps -o [format]: Customize the output format. For example, ps -o pid,cmd shows only the PID and command of each process.

Understanding the Output

ADVERTISEMENT

When you run ps aux, you typically see columns like:

  • USER: The user who owns the process.
  • PID: The process ID.
  • %CPU: The percentage of CPU usage.
  • %MEM: The percentage of memory usage.
  • VSZ: Virtual memory size.
  • RSS: Resident Set Size (the non-swapped physical memory that a task has used).
  • TTY: The terminal associated with the process.
  • STAT: The process state (e.g., S for sleeping, R for running).
  • START: The start time of the process.
  • TIME: The cumulative CPU time.
  • COMMAND: The command that started the process.

Useful Examples

Listing All systemd Services

systemd is a popular init system used in many Linux distributions. To list all systemd services, you can use:

ps -ef | grep systemd
ps -ef | grep systemd output on Ubuntu
ps -ef | grep systemd output on Ubuntu

This command will display all processes related to systemd, helping you identify active services.

List all Processes Sorted by Memory Usage

The command lists all running processes on a Linux system and sorts them in descending order by memory usage. Let’s break it down:

ps aux --sort=-%mem
  • ps: The process status command to view running processes.
  • aux:
    • a: Show processes for all users (not limited to the current session).
    • u: Display output in a user-oriented format, including user, CPU usage, memory usage, etc.
    • x: Show processes without a controlling terminal (e.g., daemon processes).
  • --sort=-%mem:
    • --sort: A flag to sort the output.
    • -%mem: Specifies the sorting column, which is %mem (percentage of memory usage).
    • The - (negative) sign ensures the output is sorted in descending order. Without the -, the processes would be listed in ascending order.

Display Specific Columns (PID, User, Command)

ps -eo pid,user,cmd
  • -e: Select all processes.
  • -o: Format the output. You can specify the columns you want to display.

Show Processes of a Specific User

ps -u username

Output of this command:

ADVERTISEMENT
 PID TTY          TIME CMD
   2960 ?        00:00:00 systemd
   2962 ?        00:00:00 (sd-pam)
   3065 ?        00:00:00 sshd
   3066 pts/0    00:00:00 bash
   3159 pts/0    00:00:00 ps

Monitor the Memory Usage at Regular Intervals

watch -n 1 'ps aux --sort=-%mem | head -n 10'
Monitor the memory usage at regular intervals
Monitor the memory usage at regular intervals

Conclusion

The ps command is a powerful tool for monitoring processes and services in a Linux system. Whether you’re diagnosing system performance issues, troubleshooting services, or managing running applications, ps provides flexibility and control.

Key Features

  • Display running processes with extensive details (PID, USER, CPU, MEMORY usage, COMMAND, and more).
  • Format output with custom columns using the -o option.
  • Sort processes based on specific criteria like CPU or memory usage (--sort flag).

You can also check this possibility of Process Management

About The Author

neo

See author's posts

ADVERTISEMENT
Previous Post

Lesson 11: Practical Linux Bash Examples and Projects

Next Post

Nextcloud: How to Upgrade Nextcloud via the Web Interface

neo

neo

Related Posts

10+ Useful Linux find Command Examples You Should Know
Commands

10+ Useful Linux find Command Examples You Should Know

Check Disk Usage on the Linux with du Command
Commands

Check Disk Usage on the Linux with du Command

Descripton for kill command on Ubuntu
Commands

Linux Process Management, kill Command

Linux Files Operation: chwon (Change Ownership of The Files)
Commands

Linux Files Operation: chown (Change Ownership of the Files)

Linux Files Operation: grep, Efficient Text Search
Commands

Linux Files Operation: grep, Efficient Text Search

Linux Files Operation: find Temp Files and Execute Commands on Found Files
Commands

How to Find Temporary Files in Linux and Execute Commands on Them

Next Post
NextCloud dashboard screenshot

Nextcloud: How to Upgrade Nextcloud via the Web Interface

Recommended

WordPress: Change Port from 433 to 8443

WordPress: Change Port from 433 to 8443

Configure FortiGate as a DHCP Server via GUI and CLI

Configure FortiGate as a DHCP Server via GUI and CLI

Install Portainer on Ubuntu 24.04 Using Docker Compose

Install Portainer on Ubuntu 24.04 Using Docker Compose

FortiGate Country Address Object Generator – Block or Allow Access by Country

FortiGate Country Address Object Generator – Block or Allow Access by Country

View & Copy Image Metadata Online – Camera & GPS Info

View & Copy Image Metadata Online – Camera & GPS Info

Categories

  • Blog
  • Cloud
    • Private
  • Linux Tutorials
    • Bash Scripting Tutorials
    • Commands
    • Networking
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Solutions
    • Docker
  • Video Tutorials
    • MikroTik Videos
  • Web Tools
ADVERTISEMENT

DefenceDev Tutorials

defencedev Logo

Whether you’re just starting or looking to expand your skills, I hope you find useful information and engaging discussions here. Let me take you through my journey and the goals behind this space!

Follow Us

Recent News

Install Portainer on Ubuntu 24.04 Using Docker Compose

Install Portainer on Ubuntu 24.04 Using Docker Compose

FortiGate Country Address Object Generator – Block or Allow Access by Country

FortiGate Country Address Object Generator – Block or Allow Access by Country

  • Site Map
  • Privacy Policy
  • Facebook Page
  • Disclaimer
  • Contact
  • About Me

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
  • Web Tools

© 2025 defencedev.com - All rights reserved.