• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / Linux Command To Check CPU and Memory Utilization In Percentage

Linux Command To Check CPU and Memory Utilization In Percentage

By Sourabh / July 25, 2022 Category: How To, Ubuntu

On Linux, how to check memory usage by process? Learn how to check CPU and memory utilization in Linux and check memory usage in Linux. Here is the Linux command to check memory utilization in percentage.

ps displays information about a selection of the active processes. It is slighyly different from top command. top command is used when you want a repetitive update of the selection and the displayed information.

List Top Memory Consuming Processes In Terminal

The ps command can be mixed with various options to show the list of top processes sorted by RAM and CPU usage. Run the following command in Terminal to see the top running processes by RAM and CPU usage:

$ ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head

Below is the screenshot of the command output:

Explaining the command and all the options users:

  1. -A Select all processes. Identical to -e.
  2. -e Select all processes. Identical to -A.
  3. -o User-defined format. Option of ps allows to specify the output format. Format is a single argument in the form of a blank-separated or comma-separated list, which offers a way to specify individual output columns.
  4. –pid pidlist process ID. Identical to -p and p.
  5. –ppid pidlist parent process ID. This selects the processes with a parent process ID in pidlist. That is, it selects processes that are children of those listed in pidlist.
  6. –sort Specify sorting order.
  7. cmd simple name of executable
  8. %cpu CPU utilization of the process in “##.#” format. Currently, it is the CPU time used divided by the time the process has been running (cputime/realtime ratio), expressed as a percentage.
  9. %mem Ratio of the process’s resident set size to the physical memory on the machine, expressed as a percentage.

list-process-2

List Top 10 CPU Consuming Processes

Similarly you can also print the top 10 CPU consuming processes. Run the following command given below:

ps -eo pid,comm,%cpu | sort -rk 3 | head

list-process-3

List Top 10 CPU & Memory Consuming Processes

Run the following command to list top 10 CPU and Memory consuming processes:

ps axo ruser,%mem,comm,pid,euser | sort -nr | head -n 10

By default, ps selects all processes with the same effective user ID (euid=EUID) as the current user and associated with the same terminal as the invoker. ps command displays the process ID (pid=PID), the terminal associated with the process (tname=TTY), the cumulated CPU time in [DD-]hh:mm:ss format (time=TIME), and the executable name (ucmd=CMD). By default, the display output is unsorted, but can be sorted using –sort options in recursive manner.

Primary Sidebar

Latest Posts

Ubuntu 25.04 ‘Plucky Puffin’ Is Available To Download

How to Login as Root User in Linux Terminal

Install Firefox In Ubuntu Terminal Command Line

How To Check Kernel Installed Date In Linux Ubuntu

How To List All Kernel Modules That Are Loaded In Ubuntu

Enable Ubuntu Auto Login Without Password

Download Ubuntu 25.04 Official Default Wallpapers

How To Fix Initramfs Error In Ubuntu Command Line

How To Check All Available Kernel Version In Linux Ubuntu

3 Best Artificial Intelligence Domain Name Generators

© 2025 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap