prtstat command

prtstat shows process information in a formatted way

Typical usage: diagnosing process issues, information gathering, troubleshooting

Introduction into prtstat

The prtstat command is a tool for Linux systems to show process information in one small overview. It retrieves its information from the /proc/PID/stat file and shows it in a formatted way.

Information that typically is included:

  • Process name
  • Process state
  • Number of threads
  • User and group information
  • Page faults
  • CPU usage
  • Memory usage
  • Process scheduler details

Example output:

Process: systemd-journal		State: S (sleeping)
  CPU#:  0  		TTY: 0:0	Threads: 1
Process, Group and Session IDs
  Process ID: 549		 Parent ID: 1
    Group ID: 549		Session ID: 549
  T Group ID: -1

Page Faults
  This Process    (minor major):    35655       135
  Child Processes (minor major):       65         0
CPU Times
  This Process    (user system guest blkio):   0,52   0,74   0,00   0,00
  Child processes (user system guest):         0,00   0,00   0,00
Memory
  Vsize:       66 MB     
  RSS:         20 MB      		RSS Limit: 18446744073709 MB
  Code Start:  0x63cedd9d7000		Code Stop:  0x63cedd9f53c1
  Stack Start: 0x7ffec869b400
  Stack Pointer (ESP):          0	Inst Pointer (EIP):          0
Scheduling
  Policy: normal
  Nice:   0 		RT Priority: 0 (non RT)

Installation

When prtstat is not installed by default, it can be added to the system using the relevant software package.

Package information for prtstat

Operating systemPackage nameInstallation
AlmaLinuxpsmisc
dnf install psmisc
Arch Linuxpsmisc
pacman -S psmisc
Debianpsmisc
apt install psmisc
Fedorapsmisc
dnf install psmisc
Red Hat Enterprise Linuxpsmisc
dnf install psmisc
Rocky Linuxpsmisc
dnf install psmisc
openSUSEpsmisc
zypper install psmisc
Ubuntupsmisc
apt install psmisc

Your Linux distribution using a different package? Share your feedback.

Usage

Frequently Asked Questions

What is the prtstat command and its purpose?

The prtstat command is a command-line tool to show a formatted representation gathered from the /proc/PID/stat file

Which package provides the prtstat command?

The command prtstat is provided by the psmisc package.

Related and similar commands

Linux has a lot of tools and commands available and sometimes you just need that little other tool. Here is a list of commands that are similar or related to prtstat:

Related and similar commands to prtstat
CommandCategorySummary
basenamefilesStrips directory and file name suffix from a given path
chrtprocessesSets Linux scheduler policy and priority for a process or command
dmidecodehardwareShows hardware information
killprocessesSending signals to processes
niceprocessesRuns commands with specified priority
numactlprocessesControls NUMA policy for processes and shared memory
peekfdprocessesTracks a process and show file descriptor activity
pidofprocessesReturns process IDs for a process name
pidstatmonitoringMonitoring CPU, memory, and disk activity
pidwaitprocessesWait for process to stop
pmapprocessesShows memory mapping of process
pscapcapabilitiesDisplay available capabilities for running processes
pslogloggingShows which log files a process has opened
pstreeprocessesShow active processes and children like a tree
pwdxprocessesShows current working directory of a process
reniceprocessesChanges the priority of running processes
slabtopmemoryShows slab usage of kernel
smemmemoryShow memory usage including swap
straceprocess inspectionInspects running process
unitsdata conversionConverts a unit into another one, like from Celcius to Fahrenheit
vmstatmemoryShows virtual memory information, disk IO, CPU activity
watchprocessesMonitors changes in output of specified command