How to list running processes in Linux {using different commands} (2023)

introduction

Every application you use or command you run on your Linux system creates a process or task. As a system administrator, you must manage processes to ensure optimal system performance.

In this tutorial, we'll cover several Linux commands that you can use to list and manage currently running processes.

How to list running processes in Linux {using different commands} (1)

requirements

  • A system running Linux
  • A root account orsudoprivileges
  • Terminal window/command line access

Non-Linux processes

Law Suitboot into linux every bootan appor run a command. While each command creates a process, applications create and run multiple processes for different tasks.

By default, each new process starts asfirst planProcedure. This means that it must complete before a new process can begin. ongoing processes inbottomallows you to perform other tasks at the same time.

To use:Learn more about terminating Linux processes in ourGuide to Terminate Processes in Linux.

List of processes running on Linux

To list the processes that are currently running, use theDP,Above,Above, Yno mole linux commands. You can also combine themDPcommand with theTapCommand to identify individual processes.

(Video) How To Show All Running Processes In Linux Using ps Command Using Command Line

List of processes running on Linux using ps command

HeDPThe Linux command creates a snapshot of currently running processes. Unlike the other commands in this list,DPrenders the output as a static list that is not updated in realtime.

HeDPThe command uses the following syntax:

ps [options]

Often usedDPCommand options include:

  • A: lists all ruin processes for all users.
  • -A, -e: Lists all processes on the system.
  • -A: Lists all processes except session leaders (instances where the process id is the same as the session id) and processes not associated with an endpoint.
  • -D: Shows all processes except session leaders.
  • --uncheck, -N: Lists all processes except those that match a custom condition.
  • F: Displays the process hierarchy as ASCII art.
  • -J: Show output in working format.
  • T: Lists all processes connected to this terminal.
  • R: Show only running processes.
  • you: Enhance the output with additional information, e.g. B. CPU and memory usage.
  • -tu: Define a user whose processes you want to list.
  • x: Include processes without TTY.

To use:See the complete list ofDPcommand options withMann pd.

execute theDPThe command with no options produces output similar to the following:

How to list running processes in Linux {using different commands} (2)

Standard output includes the following categories:

  • PID: Process identification number.
  • TTY: The type of terminal the process is running on.
  • TEMPO: Total amount of CPU usage.
  • CMD: The name of the command that started the process.

with the combination ofA,you, Yxoptions leads to more verbose output:

pd a
How to list running processes in Linux {using different commands} (3)

New Advanced Edition categories include:

(Video) Linux Tutorial: 11 List running processes

  • OF THE USER: The name of the user running the process.
  • %UPC: The percentage of CPU usage.
  • %MEM: Hememory usagePercentage.
  • VSZ: No totalvirtual memoryused by the process, in kilobytes.
  • RSS: Resident pool size, the portion of RAM occupied by the process.
  • STATE: The current state of the process.
  • TO START: the time when the process started.

To see running processes in a hierarchical view, type:

pd-axjf
How to list running processes in Linux {using different commands} (4)

To use:When using more than oneDPCommand option with hyphen ("-"), just use a hyphen before enumerating the options. For example, to use theDPcommand with the-miY-Foptions, typeps-ef.

Filter the list of processes by user with:

ps -U [user id or real name] -u [user id or real name] u

For example, display a list of processes started by the invoked userphoenix nap:

pd -u phoenixnap -u phoenixnap tu
How to list running processes in Linux {using different commands} (5)

List running processes on Linux using top command

Hesupreme commandShows the list of running processes in descending ordercpu utilization. This means that the processes that consume the most resources appear at the top of the list:

How to list running processes in Linux {using different commands} (6)

the exit ofAboveCommand updates in real-time with the default three-second refresh rate. HeAboveCommand output includes the following categories:

  • PID: Process identification number.
  • OF THE USER: The name of the user running the process.
  • public relations: The scheduling priority for the process.
  • EM: The good value of the process, with negative numbers indicating higher priority.
  • VIRTUAL: The amount of virtual memory used by the process.
  • res: The amount of resident (physical) memory used by the process.
  • SHR: The total shared memory used by the process.
  • S: The state of the process - R (running) or S (resting).
  • %UPC: The percentage of CPU usage.
  • %MEM: The percentage of memory usage.
  • TEMPO+: Total amount of CPU usage.
  • DOMAIN: The name of the command that started the process.

WhileAboveWhen the command runs, use the following options to interact with it or change the output format:

(Video) 8 1 List processes running on a system Linux Command Line

  • C: Displays the absolute path of the process.
  • D: Change the output refresh rate to a custom value (in seconds).
  • H: Displays the help window.
  • k: Kill a process by specifying the PID.
  • METRO: Sorts the list by memory usage.
  • norte: Sort list by PID.
  • R: Change the nice (priority) value of a process by specifying the PID.
  • z- Change output color to highlight running processes.
  • q: Exit the command interface.

To use:Options for interacting withAboveThe commands are case sensitive. Make sure to disable caps lock first.

List running processes on Linux with htop command

HeAboveThe command gives the same output as the commandAbovecommand, but in a more understandable and user-friendly way.

Since most Linux distributions don't include this command, install it with:

sudo apt install htop

Use ofAbovecommand returns the following output:

How to list running processes in Linux {using different commands} (7)

Use the following keys to interact with theAboveDomain:

  • arrow keys: Scroll the process list vertically and horizontally.
  • F1: Opens the help window.
  • F2: Open htop command settings.
  • F3: Search for a process by typing its name.
  • F4: Filter the process list by name.
  • F5: toggles between viewing the process hierarchy as an ordered list or as a tree.
  • F6: Sort processes by columns.
  • F7: Decreases the nice value of a process (increases priority).
  • F8: Increases the nice value (decreases priority) of a process.
  • F9: ends the selected process.
  • F10: Exit the command interface.

List processes running on Linux using above command

Heno moleCommand provides a more comprehensive overview of running processes compared to theAboveDomain. Start by installing theno molecommand with:

sudo apt install above

Heno moleThe command creates output similar to the following:

How to list running processes in Linux {using different commands} (8)

The command's output header provides an overview of system resources, including process and performance-related statistics, as well as memory, disk, and network usage.

(Video) ps command in linux to view all processes

The bottom section lists the processes that are currently running and contains the following categories:

  • PID: Process identification number.
  • SYSCPU: The CPU usage by the process during system processing.
  • USRCPU: The CPU usage by the process when running in user mode.
  • VGROW: The amount of virtual memory the process has used since the output was last updated.
  • RGROW: The amount of physical memory the process has used since the output was last updated.
  • TIMBRE: The actual user ID of the user who initiated the process.
  • CALLE: The current state of the process.
  • EXCL: The exit code after the process ends.
  • THR: The number of threads used by the process.
  • S: The current state of the main thread of the process.
  • CPUNR: The number of CPUs used by the process.
  • UPC: The percentage of CPU used by the process.
  • CMD: The name of the command that started the process.

Use ofno moleThe command with the following options changes the output format:

  • -A: Show only running processes.
  • -C: Show command line by process.
  • -D: Show disc information.
  • -eu: Displays totals as an average per second.
  • -METRO: View memory information.
  • -NORTE: Display network information.
  • -S: Show process planning information.
  • -v: Displays verbose output.
  • -y: Show individual topics.

Use the following flags to interact with theno moleDomain:

  • A: Sort by the most active features.
  • C: Sort by CPU usage.
  • D: Sort by disk activity.
  • METRO: Sort by memory usage.
  • norte: Sort by network activity.

Find process IDs with the pgrep command

Use ofTapThe command allows you to search for a specific process. HeTapThe command uses the following syntax:

pgrep [process name]

For example, use the following command to find thefire FoxProcedure:

fire Fox

The output of the command lists the PID of the process:

How to list running processes in Linux {using different commands} (9)

Use is PID com oDPYou can use the command to get more information about the process. In this example, using PID 1439 provides information about thefire FoxProcedure:

pd-e | confiscated in 1439
How to list running processes in Linux {using different commands} (10)

Diploma

After reading this tutorial you will be able to useDP,Above,Above, Yno moleCommands for listing and managing running processes in Linux.

(Video) How To Check Running Process In Ubuntu Linux Using Command Line

Use the available command options to customize the command's output and behavior.

FAQs

How can I list all the running processes on a Linux machine? ›

To list processes in Linux, use one of the three commands: ps, top or htop. Ps command provides static snapshot of all processes, while top and htop sorts by CPU usage.

What command will list all running processes? ›

You can use the ps command to find out which processes are running and display information about those processes. The ps command has several flags that enable you to specify which processes to list and what information to display about each process.

How do I see multiple processes in Linux? ›

You need to use the ps command. It provides information about the currently running processes, including their process identification numbers (PIDs). Both Linux and UNIX support the ps command to display information about all running process. The ps command gives a snapshot of the current processes.

How do you list all used commands in Linux? ›

In Linux, there is a very useful command to show you all of the last commands that have been recently used. The command is simply called history, but can also be accessed by looking at your . bash_history in your home folder. By default, the history command will show you the last five hundred commands you have entered.

How do I see what processes are running in UNIX? ›

Check running process in Unix
  1. Open the terminal window on Unix.
  2. For remote Unix server use the ssh command for log in purpose.
  3. Type the ps aux command to see all running process in Unix.
  4. Alternatively, you can issue the top command to view running process in Unix.
Dec 27, 2018

How are you able to list processes using the command prompt? ›

Just tap on Start, type cmd.exe and open the Command Prompt from the results to get started. Simply typing tasklist and hitting the Enter-key displays a list of all running processes on the system. Each process is listed with its name, process ID, session name and number, and memory usage.

How to see process history in Linux? ›

Using ps -ef will display details on all of the processes running on the system but ps -eF will add some additional details. Both commands show who is running the process, the process and parent process IDs, process start time, accumulated run time and the task being run.

How do you view the running programs and processes on a Linux system? ›

To list currently running processes, use the ps , top , htop , and atop Linux commands. You can also combine the ps command with the pgrep command to identify individual processes.

How do I find the top 10 processes in Linux? ›

Use ps Command to Find Top Processes by Memory and CPU Usage

ps is a Linux command-line utility with many options that helps you to display output in different formats. You can use the ps command with –sort argument to sort the output by memory and CPU usage.

How do I get a list of commands? ›

You can open the Command Prompt by pressing ⊞ Win + R to open the Run box and typing cmd . Windows 8 users can also press ⊞ Win + X and select Command Prompt from the menu. Retrieve the list of commands. Type help and press ↵ Enter .

How do I list all commands in terminal? ›

ls. The ls command stands for List. We can use it to list all the contents of the specified directory; if no path is specified, it will list everything in the current directory. Use -a flag to list hidden files and directories.

What is the shell command to list all the commands? ›

ls. The 'ls' command lists the contents of either the current directory or the directories listed on the command line.

How do I see what services are running in Linux command line? ›

To check a service's status, use the systemctl status service-name command.

How to find process by name in Linux? ›

Using the ps Command

The ps command is the standard tool to check current processes' status in the Linux command line. As the output above shows, we've seen the expected process name in the CMD column. We can also adjust the ps command's -o option to ask ps to output only required information.

How do I see what processes are running in bash? ›

Bash commands to check running process:
  1. pgrep command – Looks through the currently running bash processes on Linux and lists the process IDs (PID) on screen.
  2. pidof command – Find the process ID of a running program on Linux or Unix-like system.
Oct 19, 2022

Which command displays the list of all open files and processes? ›

The open source lsof command is also useful for providing information about files opened by processes, and files opened under specific user accounts.

How do I see all processes in Ubuntu? ›

Ubuntu also has a graphical program to view current processes. Navigate to System–>Administrator–>System Monitor,you will see system processes at Process tab,kill any by select it and click “End Process” button.

How do I see hidden processes in Linux? ›

unhide is a forensic tool to find processes hidden by rootkits, Linux kernel modules or by other techniques. It detects hidden processes using three techniques: The proc technique consists of comparing /proc with the output of /bin/ps.

How do I trace a process in Linux? ›

Trace Linux Process PID

If a process is already running, you can trace it by simply passing its PID as follows; this will fill your screen with continues output that shows system calls being made by the process, to end it, press [Ctrl + C] . $ sudo strace -p 3569 strace: Process 3569 attached restart_syscall(<...

What is list command in Linux? ›

The ls is the list command in Linux. It will show the full list or content of your directory. Just type ls and press the enter key.

How do I manage processes in Linux? ›

Different Commands for Process Management in Linux
  1. The top Command for Mananging Linux Processes. To track the running processes on your machine you can use the top command. ...
  2. ps command. ps command is short for 'Process Status'. ...
  3. Stop a process. To stop a process in Linux, use the 'kill' command. ...
  4. Change priority of a process.
Aug 3, 2022

How to check resource usage in Linux? ›

Check CPU Usage with Iostat Command

Run the iostat command without any option will display the information about CPU utilization, device utilization, and network file system utilization. Use the -c option to break the CPU utilization into user processes, system processes, I/O wait, and idle time.

How to check process by PID in Linux? ›

The easiest way to find out if process is running is run ps aux command and grep process name. If you got output along with process name/pid, your process is running.

What is a list of commands called? ›

Menus are lists of commands that appear on the screen. In computing and telecommunications, a menus is a list of options or commands presented to the user of a computer or communications system. A menu may either be a system's entire user interface, or only part of a more complex one.

What are command lists? ›

A command list is a sequence of GPU commands that can be recorded and played back. A command list may improve performance by reducing the amount of overhead generated by the runtime.

What is the command to display all the commands of all types? ›

Get-Command * gets all types of commands, including all of the non-PowerShell files in the Path environment variable ( $env:Path ), which it lists in the Application command type.

Which command is used to list all the files? ›

In Linux, the command "ls" is one of the most commonly used. It's used to display a list of files and sub-directories in the current directory. If you're new to using the command line, the first command you should learn is probably ls. This command can be used by both regular users as well as system administrators.

How do I list all commands in bash? ›

In bash, you can list all command names of any type with compgen -c . You can use compgen -A alias , compgen -A builtin compgen -A function to list commands of a specific type. You can pass an additional string to compgen to list only commands that start with that prefix.

Which folder have information about all running processes in Linux? ›

The directory /proc represents a virtual filesystem in Linux that contains runtime system information, including process information. There are some numbered directories in the /proc directory, each corresponding to an actual process ID.

How do I see running process logs in Linux? ›

This is such a crucial folder on your Linux systems. Open up a terminal window and issue the command cd /var/log. Now issue the command ls and you will see the logs housed within this directory (Figure 1).

How to get process details using PID in Linux? ›

A process is nothing but running instance of a program and each process has a unique PID on a Unix-like system. The easiest way to find out if process is running is run ps aux command and grep process name. If you got output along with process name/pid, your process is running.

How do I see a list of services in Linux? ›

To see all running services on a Linux system with systemd, use the command "systemctl --type=service --state=running". This will show you each active service's name, load, sub-state, and description. You can also change the state value to see services that are dead, exited, failed, or inactive.

What Linux command shows all files? ›

-
  • To list all files in the current directory, type the following: ls -a This lists all files, including. dot (.) ...
  • To display detailed information, type the following: ls -l chap1 .profile. ...
  • To display detailed information about a directory, type the following: ls -d -l .

Which Linux command is used to manage processes? ›

1. The top Command for Mananging Linux Processes. To track the running processes on your machine you can use the top command. Top command displays a list of processes that are running in real-time along with their memory and CPU usage.

How to find process path Linux? ›

3. Finding the Process Path
  1. 3.1. proc File System and exe Symbolic Link. Information about processes is stored under the /proc directory, also called the proc filesystem. ...
  2. 3.2. Using readlink Command and exe Symbolic Link. ...
  3. 3.3. Using realpath Command and exe Symbolic Link. ...
  4. 3.4. Using ls Command and exe Symbolic Link.
Apr 1, 2022

Videos

1. See The Users that have Running Processes on Linux System
(Brain I/O)
2. Linux Tutorial | Running Processes in the Foreground & Background
(Rohan Arora)
3. How to use the ps Command | Linux Command Line Basics
(Linode)
4. How to kill Process in Linux
(HOWTECH)
5. Part 13 - Unix/Linux for Testers | Process Commands - ps and kill
(SDET- QA Automation Techie)
6. Linux Basic Process Control Command
(Linux Tutorial)

References

Top Articles
Latest Posts
Article information

Author: Dr. Pierre Goyette

Last Updated: 08/09/2023

Views: 5846

Rating: 5 / 5 (70 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Dr. Pierre Goyette

Birthday: 1998-01-29

Address: Apt. 611 3357 Yong Plain, West Audra, IL 70053

Phone: +5819954278378

Job: Construction Director

Hobby: Embroidery, Creative writing, Shopping, Driving, Stand-up comedy, Coffee roasting, Scrapbooking

Introduction: My name is Dr. Pierre Goyette, I am a enchanting, powerful, jolly, rich, graceful, colorful, zany person who loves writing and wants to share my knowledge and understanding with you.