• Contact
  • About Me
  • Privacy Policy
  • Disclaimer
DefenceDev
  • Home
  • Linux
    • Bash Scripting
      • Bash Scripting Lessons
    • Commands&Tips
    • Monitoring
  • Networking
    • FortiGate
    • MikroTik
  • Projects & Case Studies
  • Self-Hosted
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Virtualization
    • Proxmox
    • VMware
  • Tools
No Result
View All Result
  • Home
  • Linux
    • Bash Scripting
      • Bash Scripting Lessons
    • Commands&Tips
    • Monitoring
  • Networking
    • FortiGate
    • MikroTik
  • Projects & Case Studies
  • Self-Hosted
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Virtualization
    • Proxmox
    • VMware
  • Tools
No Result
View All Result
DefenceDev
No Result
View All Result
Home Linux Commands&Tips

Check Running Processes and Services in Linux via ps

by neo
September 3, 2026
in Commands&Tips
0
Linux Process, List all Running Services with ps Command

Linux Process, List all Running Services with ps Command

0
SHARES
69
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

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:

 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

Tags: linuxmonitoring
Previous Post

Lesson 11: Practical Linux Bash Examples and Projects

Next Post

Nextcloud: How to Upgrade Nextcloud via the Web Interface

neo

Related Posts

10+ Useful Linux find Command Examples You Should Know
Commands&Tips

10+ Useful Linux find Command Examples You Should Know

My Ultimate Linux/Ubuntu Commands Cheat Sheet (2025)
Commands&Tips

My Ultimate Linux/Ubuntu Commands Cheat Sheet (2025)

Timeshift on Linux: How to Create and Restore System Snapshots
Commands&Tips

Timeshift on Linux: How to Create and Restore System Snapshots

Remote Desktop Access to Ubuntu 24.04 from Windows
Commands&Tips

Remote Desktop Access to Ubuntu 24.04 from Windows

Fix "blk_update_request: critical target error" on Ubuntu Server (dev sdb, DISCARD Operation)
Commands&Tips

Fix “blk_update_request: critical target error” on Ubuntu Server with SSD (dev sdb, DISCARD Operation)

Passwordless SSH Login on Ubuntu: Secure Server Access
Commands&Tips

Passwordless SSH Login on Ubuntu: Secure Server Access

Next Post
NextCloud dashboard screenshot

Nextcloud: How to Upgrade Nextcloud via the Web Interface

Recommended

MikroTik: Firmware Update with WinBox Application - Manual Approach

MikroTik: Firmware Update with WinBox Application – Manual Approach

How to Remove Application from an Ubuntu Server using apt-get

How to Remove Application from an Ubuntu Server using apt-get

Briefly unavailable for scheduled maintenance. Check back in a minute.

WordPress Stuck in Maintenance Mode After Plugin Update

Promox Telegram Alert Example

Configure Telegram Notifications in Proxmox VE Using Webhooks

Fix Proxmox VM Snapshot “Out of Space” Errors

Fix Proxmox VM Snapshot “Out of Space” Errors

Categories

  • Linux
    • Bash Scripting
    • Commands&Tips
    • Monitoring
  • Networking
    • FortiGate
    • MikroTik
  • Projects & Case Studies
  • Self-Hosted
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Virtualization
    • Proxmox
    • VMware
  • Web Tools

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

Briefly unavailable for scheduled maintenance. Check back in a minute.

WordPress Stuck in Maintenance Mode After Plugin Update

Promox Telegram Alert Example

Configure Telegram Notifications in Proxmox VE Using Webhooks

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

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Linux
    • Bash Scripting
      • Bash Scripting Lessons
    • Commands&Tips
    • Monitoring
  • Networking
    • FortiGate
    • MikroTik
  • Projects & Case Studies
  • Self-Hosted
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Virtualization
    • Proxmox
    • VMware
  • Tools

© 2025 defencedev.com - All rights reserved.