• 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 / How To Find Process Id In Linux

How To Find Process Id In Linux

By Sourabh / July 11, 2023 Category: How To, Ubuntu

Wondering how to find process id in Linux and check running process in Ubuntu terminal, read to find how to find process id in Linux?

Get Pid Of Process In Linux Ubuntu

You can find the PID of processes running on the system using the below nine command.

  1. pidof: pidof – find the process ID of a running program.
  2. pgrep: pgrep – look up or signal processes based on name and other attributes.
  3. ps: ps – report a snapshot of the current processes.
  4. pstree: pstree – display a tree of processes.
  5. ss: ss is used to dump socket statistics.
  6. netstat: netstat is displays a list of open sockets.
  7. lsof: lsof – list open files.
  8. fuser: fuser – list process IDs of all processes that have one or more files open
  9. systemctl: systemctl – Control the systemd system and service manager

pidof

The pidof command is used to find the process ID of a running program. Pidof finds the process id’s (PIDs) of the named programs. It prints those id’s on the standard output.

NOTE: In the above command output (screenshot) you may see more than one process IDs because it displays all PIDs – including parent and child against the specified process name (given along the command as argument/option).

When pidof is invoked with a full pathname to the program it should find the pid of, it is reasonably safe. Otherwise it is possible that it returns PIDs of running programs that happen to have the same name as the program you’re after but are actually other programs.

In this case – when we need to find the Parent Process PID (PPID) – the first number is the parent process id. In this case it is 48723 (see screenshot above). Also note that all the process ids are sorted in descending order.

pstree

Another great command to find the process is pstree. The pstree command shows running processes as a tree-like format which is very easy to display the process hierarchy. It is easy to read and understand the command output as it makes the output more visually appealing.

pstree displays a tree of processes. pstree shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown. pstree visually merges identical branches by putting them in square brackets and prefixing them with the repetition count.

Similarly you can use other commands (listed above).

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