prtstat command
prtstat shows process information in a formatted way
Typical usage: diagnosing process issues, information gathering, troubleshootingIntroduction 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 system | Package name | Installation |
|---|---|---|
| AlmaLinux | psmisc | |
| Arch Linux | psmisc | |
| Debian | psmisc | |
| Fedora | psmisc | |
| Red Hat Enterprise Linux | psmisc | |
| Rocky Linux | psmisc | |
| openSUSE | psmisc | |
| Ubuntu | 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:
| Command | Category | Summary |
|---|---|---|
| basename | files | Strips directory and file name suffix from a given path |
| chrt | processes | Sets Linux scheduler policy and priority for a process or command |
| dmidecode | hardware | Shows hardware information |
| kill | processes | Sending signals to processes |
| nice | processes | Runs commands with specified priority |
| numactl | processes | Controls NUMA policy for processes and shared memory |
| peekfd | processes | Tracks a process and show file descriptor activity |
| pidof | processes | Returns process IDs for a process name |
| pidstat | monitoring | Monitoring CPU, memory, and disk activity |
| pidwait | processes | Wait for process to stop |
| pmap | processes | Shows memory mapping of process |
| pscap | capabilities | Display available capabilities for running processes |
| pslog | logging | Shows which log files a process has opened |
| pstree | processes | Show active processes and children like a tree |
| pwdx | processes | Shows current working directory of a process |
| renice | processes | Changes the priority of running processes |
| slabtop | memory | Shows slab usage of kernel |
| smem | memory | Show memory usage including swap |
| strace | process inspection | Inspects running process |
| units | data conversion | Converts a unit into another one, like from Celcius to Fahrenheit |
| vmstat | memory | Shows virtual memory information, disk IO, CPU activity |
| watch | processes | Monitors changes in output of specified command |
Also 💙 the command-line or terminal? Here is a set of cheat sheets for Linux to get more done from within the shell: