Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork131
A modern replacement for ps written in Rust
License
dalance/procs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
procs is a replacement forps
written inRust.
- Colored and human-readable output
- Automatic theme detection based on terminal background
- Multi-column keyword search
- Some additional information which are not supported by
ps
- TCP/UDP port
- Read/Write throughput
- Docker container name
- More memory information
- Pager support
- Watch mode (like
top
) - Tree view
- Linux is supported.
- macOS is experimentally supported.
- macOS version is checked on GitHub Actions environment only.
- The issues caused by real-machine are welcome.
- Windows is supported.
- FreeBSD is experimentally supported.
Download fromrelease page, and extract to the directory in PATH.
You can install fromNixpkgs.
nix-env --install procs
You can install fromsnapcraft.
sudo snap install procs
You can install fromhomebrew.
brew install procs
You can install fromMacPorts.
sudo port install procs
You can install from theAlpine Linux repository.
The correct repository (see above link for the most up-to-date information) should be enabled beforeapk add
.
sudo apk add procs
You can install from theArch Linux extra repository.
sudo pacman -S procs
You can install withscoop.
scoop install procs
sudo dnf install procs
winget install procs
You can install with rpm.
sudo rpm -i https://github.com/dalance/procs/releases/download/v0.14.10/procs-0.14.10-1.x86_64.rpm
You can install withcargo.
cargo install procs
You can install withx-cmd.
x env use procs# orx procs # Download procs, and invoke procs in a way that does not affect the current environment
On macOS, normal users can't access any information on other users' processes.On Linux, normal users can't access some information (ex. Read/Write throughput) of other users.
If you want to show this information, you should usesudo
.
$sudo procs[sudo] password for ...:
If you want to skip password input, you can add the following entry to/etc/sudoers
.
[user or group] ALL= NOPASSWD: [procs binary path]// ex. myuser ALL= NOPASSWD: /usr/local/bin/procs
In the following screenshots,config/large.toml
is used as the configuration.
Typeprocs
only. It shows the information of all processes.
procs
If you add any keyword as argument, it is matched toUSER
,Command
by default.
procs zsh
If you want to add columns matching to non-numeric keyword,nonnumeric_search
option can be used in configuration file.
If a numeric is used as the keyword, it is matched toPID
by default.Numeric is treated as exact match, and non-numeric is treated as partial match by default.
procs --or 6000 60000 60001 16723
If you want to add columns matching to numeric keyword,numeric_search
option can be used in configuration file.
Note that procfs permissions only allow identifying listening ports for processes owned by the current user, so not all ports will show up unless run as root.
If there are some keywords, logical operation between the keywords can be specified by commandline option.
--and
: The processes that match with all keywords are shown.--or
: The processes that match with any keyword are shown.--nand
: The processes are shown unless these match with all keywords.--nor
: The processes are shown unless these match with any keyword.
The default operation can be specified in theconfiguration file. See[search]
section.
If you have access permission to docker daemon (unix:///var/run/docker.sock
),Docker
column is added.
procs growi
Note that procs gets the container information through UNIX domain socket, soDocker Toolbox on macOS (doesn't use UNIX domain socket) is not supported.Docker Desktop for Mac is supported but not tested.
If output lines exceed terminal height, pager is used automatically.This behavior and pager command can be specified byconfiguration file.
On Linux and macOS,less
is the default pager.If there is notless
,more
is used.Instead of them, built-in pager can be used by configurationuse_builtin
.
On Windows, built-in pager is always used.
If--watch
or--watch-interval <second>
option is used, procs automatically updates output liketop
.If--watch
is used, the update interval becomes 1s.The update interval can be specified by the argument of--watch-interval
.There are some keyboard shortcuts to control.
n
: Change the sort column to the next columnp
: Change the sort column to the previous columna
: Change the sort order to ascendingd
: Change the sort order to descendingq
: Quit
If--tree
option is used, processes are sorted by dependency order and dependency tree is shown at left side.
procs --tree
IfTreeSlot
column exists in config, dependency tree is shown at the slot.
Column sort order can be changed by--sorta
or--sortd
option.The last character of--sorta
and--sortd
means sort order: "a"scending and "d"escending.
The column for sort is selected by the option keyword.The keyword is matched with column kind that is shown by--list
option.If--sorta cputime
, column is sorted byCpuTime
with ascending order.If--sortd rss
, column is sorted byVmRss
with descending order.The keyword is matched partially and case is ignored.
The default sort is specified by[sort]
section in theconfiguration file.
procs --sortd cpu
--insert
option inserts new column to the position ofSlot
column orMultiSlot
column.The column for insert is selected by the option keyword.The keyword is the same as sort option.ASlot
column can be used by an inserted column.If many insertions are required, manySlot
columns should be added.AMultiSlot
column can be used by many inserted columns.If there is aMultiSlot
, all the remaining columns are inserted to theMultiSlot
, and the subsequentSlot
/MultiSlot
is not used.UnusedSlot
/MultiSlot
is not shown.
--gen-completion
option generates shell completion files under the current directory.The following shells are supported.
zsh
bash
fish
powershell
elvish
--gen-completion-out
option generates shell completion to stdout.You can source it directly on some shells.
source <(procs --gen-completion-out bash)
You can change configuration by writing a configuration file.There are some configuration examples inconfig
directory of this repository.config/large.toml
is the default configuration before procs v0.9.21.
The locations of the configuration file is OS-specific:
- Linux:
~/.config/procs/config.toml
,/etc/procs/procs.toml
- macOS:
~/Library/Preferences/com.github.dalance.procs/config.toml
,/etc/procs/procs.toml
- Windows:
~/AppData/Roaming/dalance/procs/config/config.toml
For compatibility, if~/.procs.toml
exists, it will be preferred tothe OS-specific locations.
--use-config
option can specify a built-in configuration.--load-config
option can specify a configuration file path.
The complete example of a configuration file can be generated by--gen-config
option.
[[columns]]kind ="Pid"style ="BrightYellow|Yellow"numeric_search =truenonnumeric_search =false[[columns]]kind ="Username"style ="BrightGreen|Green"numeric_search =falsenonnumeric_search =truealign ="Right"[style]header ="BrightWhite|Black"unit ="BrightWhite|Black"tree ="BrightWhite|Black"[style.by_percentage]color_000 ="BrightBlue|Blue"color_025 ="BrightGreen|Green"color_050 ="BrightYellow|Yellow"color_075 ="BrightRed|Red"color_100 ="BrightRed|Red"[style.by_state]color_d ="BrightRed|Red"color_r ="BrightGreen|Green"color_s ="BrightBlue|Blue"color_t ="BrightCyan|Cyan"color_z ="BrightMagenta|Magenta"color_x ="BrightMagenta|Magenta"color_k ="BrightYellow|Yellow"color_w ="BrightYellow|Yellow"color_p ="BrightYellow|Yellow"[style.by_unit]color_k ="BrightBlue|Blue"color_m ="BrightGreen|Green"color_g ="BrightYellow|Yellow"color_t ="BrightRed|Red"color_p ="BrightRed|Red"color_x ="BrightBlue|Blue"[search]numeric_search ="Exact"nonnumeric_search ="Partial"logic ="And"[display]show_self =falseshow_thread =falseshow_thread_in_tree =truecut_to_terminal =truecut_to_pager =falsecut_to_pipe =falsecolor_mode ="Auto"[sort]column =0order ="Ascending"[docker]path ="unix:///var/run/docker.sock"[pager]mode ="Auto"
[[columns]]
section defines which columns are used.The first[[columns]]
is shown at left side, and the last is shown at right side.
Key | Value | Default | Description |
---|---|---|---|
kind | Seekind list | Column type | |
style | Seestyle list | Column style | |
numeric_search | true, false | false | Whether the column can be matched with numeric keywords |
nonnumeric_search | true, false | false | Whether the column can be matched with non-numeric keywords |
align | Left, Right, Center | Left | Text alignment |
max_width | [Number] | Maximum column width | |
min_width | [Number] | Minimum column width | |
header | [String] | Alternate header description |
procskind | ps STANDARD FORMAT | Description | Linux | macOS | Windows | FreeBSD |
---|---|---|---|---|---|---|
Arch | -not supported- | Architecture of binary (macOS specific) | o | |||
Ccgroup | -not supported- | Control group by compressed format | o | |||
Cgroup | cgroup | Control group | o | |||
Command | args | Command with all arguments | o | o | o | o |
ContextSw | -not supported- | Context switch count | o | o | o | |
CpuTime | cputime | Cumulative CPU time | o | o | o | o |
Docker | -not supported- | Docker container name | o | o | ||
Eip | eip | Instruction pointer | o | |||
ElapsedTime | -not supported- | Elapsed time | o | o | o | o |
Env | e output modifier | Environment variables | o | o | ||
Esp | esp | Stack pointer | o | |||
FileName | comm | File name | o | o | ||
Gid | egid | Group ID | o | o | o | o |
GidFs | fgid | File system group ID | o | |||
GidReal | rgid | Real group ID | o | o | o | |
GidSaved | sgid | Saved group ID | o | o | o | |
Group | egroup | Group name | o | o | o | o |
GroupFs | fgroup | File system group name | o | |||
GroupReal | rgroup | Real group name | o | o | o | |
GroupSaved | sgroup | Saved group name | o | o | o | |
MajFlt | maj_flt | Major page fault count | o | o | o | o |
MinFlt | min_flt | Minor page fault count | o | o | o | |
MultiSlot | -not supported- | Slot for--insert option | o | o | o | o |
Nice | ni | Nice value | o | o | o | |
Pgid | pgid | Process group ID | o | o | o | |
Pid | pid | Process ID ( or Thread ID sorrunded by[] ) | o | o | o | o |
Policy | policy | Scheduling policy | o | o | ||
Ppid | ppid | Parent process ID | o | o | o | o |
Priority | pri | Priority | o | o | o | o |
Processor | psr | Currently assigned processor | o | o | ||
ReadBytes | -not supported- | Read bytes from storage | o | o | o | o |
RtPriority | rtprio | Real-time priority | o | |||
SecContext | label | Security context | o | |||
Separator | -not supported- | Show| for column separation | o | o | o | o |
Session | sid | Session ID | o | o | o | |
ShdPnd | pending | Pending signal mask for process | o | o | ||
SigBlk | blocked | Blocked signal mask | o | o | ||
SigCgt | caught | Caught signal mask | o | o | ||
SigIgn | ignored | Ignored signal mask | o | o | ||
SigPnd | pending | Pending signal mask for thread | o | |||
Slot | -not supported- | Slot for--insert option | o | o | o | o |
Ssb | -not supported- | Speculative store bypass status | o | |||
StartTime | start_time | Starting time | o | o | o | o |
State | s | Process state | o | o | o | |
TcpPort | -not supported- | Bound TCP ports | o | o | ||
Threads | nlwp | Thread count | o | o | o | |
TreeSlot | -not supported- | Slot for tree column | o | o | o | o |
Tty | tty | Controlling TTY | o | o | o | |
UdpPort | -not supported- | Bound UDP ports | o | o | ||
Uid | euid | User ID | o | o | o | o |
UidFs | fuid | File system user ID | o | |||
UidLogin | -not supported- | Login user ID | o | |||
UidReal | ruid | Real user ID | o | o | o | |
UidSaved | suid | Saved user ID | o | o | o | |
UsageCpu | %cpu | CPU utilization | o | o | o | o |
UsageMem | %mem | Memory utilization | o | o | o | o |
User | euser | User name | o | o | o | o |
UserFs | fuser | File system user name | o | |||
UserLogin | -not supported- | Login user name | o | |||
UserReal | ruser | Real user name | o | o | o | |
UserSaved | suser | Saved user name | o | o | o | |
VmData | -not supported- | Data size | o | o | ||
VmExe | trs | Text segments size | o | o | ||
VmHwm | -not supported- | Peak resident set size | o | o | o | |
VmLib | -not supported- | Library code size | o | |||
VmLock | -not supported- | Locked memory size | o | |||
VmPeak | -not supported- | Peak virtual memory size | o | o | ||
VmPin | -not supported- | Pinned memory size | o | o | ||
VmPte | -not supported- | Page table entries size | o | |||
VmRss | rss | Resident set size | o | o | o | o |
VmSize | vsz | Physical page size | o | o | o | o |
VmStack | -not supported- | Stack size | o | o | ||
VmSwap | -not supported- | Swapped-out virtual memory size | o | o | ||
Wchan | wchan | Process sleeping kernel function | o | o | ||
WorkDir | -not supported- | Current working directory | o | |||
WriteByte | -not supported- | Write bytes to storage | o | o | o | o |
- BrightBlack
- BrightRed
- BrightGreen
- BrightYellow
- BrightBlue
- BrightMagenta
- BrightCyan
- BrightWhite
- Black
- Red
- Green
- Yellow
- Blue
- Magenta
- Cyan
- White
- Color256
- ByPercentage
- ByState
- ByUnit
There are some special styles likeByPercentage
,ByState
,ByUnit
.These are the styles for value-aware coloring.For example, ifByUnit
is chosen, color can be specified for each unit of value ( likeK
,M
,G
,,, ).The colors can be configured in[style.by_unit]
section.
Other colors can be configured as the same ascolor
.
[style]
section defines colors of header, unit and each styles.The available list of color is below.
Subsection | Key | Value | Default | Description |
---|---|---|---|---|
header | Seecolor list | BrightWhite|Black | Header color | |
unit | Seecolor list | BrightWhite|Black | Unit color | |
tree | Seecolor list | BrightWhite|Black | Tree color | |
by_percentage | color_000 | Seecolor list | BrightBlue|Blue | Color at 0% - 25% |
by_percentage | color_025 | Seecolor list | BrightGreen|Green | Color at 25% - 50% |
by_percentage | color_050 | Seecolor list | BrightYellow|Yellow | Color at 50% - 75% |
by_percentage | color_075 | Seecolor list | BrightRed|Red | Color at 75% - 100% |
by_percentage | color_100 | Seecolor list | BrightRed|Red | Color at 100% - |
by_state | color_d | Seecolor list | BrightRed|Red | Color atD state |
by_state | color_r | Seecolor list | BrightGreen|Green | Color atR state |
by_state | color_s | Seecolor list | BrightBlue|Blue | Color atS state |
by_state | color_t | Seecolor list | BrightCyan|Cyan | Color atT state |
by_state | color_z | Seecolor list | BrightMagenta|Magenta | Color atZ state |
by_state | color_x | Seecolor list | BrightMagenta|Magenta | Color atX state |
by_state | color_k | Seecolor list | BrightYellow|Yellow | Color atK state |
by_state | color_w | Seecolor list | BrightYellow|Yellow | Color atW state |
by_state | color_p | Seecolor list | BrightYellow|Yellow | Color atP state |
by_unit | color_k | Seecolor list | BrightBlue|Blue | Color at unitK |
by_unit | color_m | Seecolor list | BrightGreen|Green | Color at unitM |
by_unit | color_g | Seecolor list | BrightYellow|Yellow | Color at unitG |
by_unit | color_t | Seecolor list | BrightRed|Red | Color at unitT |
by_unit | color_p | Seecolor list | BrightRed|Red | Color at unitP |
by_unit | color_x | Seecolor list | BrightBlue|Blue | Color at other unit |
- BrightBlack
- BrightRed
- BrightGreen
- BrightYellow
- BrightBlue
- BrightMagenta
- BrightCyan
- BrightWhite
- Black
- Red
- Green
- Yellow
- Blue
- Magenta
- Cyan
- White
- Color256
Colors can be configured by theme through|
.
style ="BrightWhite|Black"# BrightWhite for dark theme and Black for light themestyle ="BrightWhite"# BrightWhite for both theme
The first color is for dark theme, and the second is for light theme.If only a color is specified, the color is applied to both theme.
Color256
can be specified by 0-255 value like below:
style ="223|112"# 223 for dark theme and 112 for light themestyle ="223"# 223 for both theme
[search]
section defines option for Keyword search.
Key | Value | Default | Description |
---|---|---|---|
numeric_search | Exact, Partial | Exact | Whether numeric keywords match exactly or partially |
nonnumeric_search | Exact, Partial | Partial | Whether non-numeric keywords match exactly or partially |
logic | And, Or, Nand, Nor | And | Logical operation between keywords |
case | Smart, Insensitive, Sensitive | Smart | Case sensitivity in search |
case
is case sensitivity in search.
Smart
: If keyword contains uppercase character, case sensitive search. Otherwise case insensitive searchInsensitive
: case insensitive searchSensitive
: case sensitive search
[display]
section defines option for output display.
Key | Value | Default | Description |
---|---|---|---|
show_self | true, false | false | Whether the self process (procs ) is shown |
show_self_parents | true, false | false | Whether the parents which have self as the only child process are shown |
show_thread | true, false | false | Whether the thread information is shown ( Linux only ) |
show_thread_in_tree | true, false | true | Whether the thread information is shown in tree mode ( Linux only ) |
show_parent_in_tree | true, false | true | Whether the parent process is shown in tree mode |
show_children_in_tree | true, false | true | Whether the children processes are shown in tree mode |
show_header | true, false | true | Whether header row is shown |
show_footer | true, false | false | Whether footer row is shown |
show_kthreads | true, false | true | Whether processes which belong to kthread are shown ( Linux only ) |
cut_to_terminal | true, false | true | Whether output lines are truncated for output into terminal |
cut_to_pager | true, false | false | Whether output lines are truncated for output into pager |
cut_to_pipe | true, false | false | Whether output lines are truncated for output into pipe |
color_mode | Auto, Always, Disable | Auto | The default behavior of output coloring without--color commandline option |
separator | [String] | │ | String used as Separator |
ascending | [String] | ▲ | Ascending sort indicator |
descending | [String] | ▼ | Descending sort indicator |
tree_symbols | [String; 5] | [│, ─, ┬, ├, └] | Symbols used by tree view |
abbr_sid | true, false | true | Whether machine SID is abbreviated ( Windows only ) |
theme | Auto, Dark, Light | Auto | Default theme |
Ifcolor_mode
isAuto
, color is enabled for terminal and pager, disabled for pipe.
Iftheme
isAuto
, theme is detected from terminal automatically.Some terminal don't support the automatic detection, soDark
orLight
can be specified explicitly.
Windows SID is too long, so it is abbreviated by default.Ifabbr_sid
isfalse
, SID is fully shown like below:
S-1-5-21-789457439-2186958450-1652286173-1001
Ifabbr_sid
istrue
, SID is shown like below:
S-1-5-21-...-1001
[sort]
section defines the column used for sort and sort order.
Key | Value | Default | Description |
---|---|---|---|
column | [Number] | 0 | Column number to used for sort |
order | Ascending, Descending | Ascending | Sort order |
Ifcolumn
is 0, value is sorted by the left column.
[docker]
section defines how to communicate to docker daemon.
Key | Value | Default | Description |
---|---|---|---|
path | [Path] | unix:///var/run/docker.sock | UNIX domain socket to docker daemon |
[pager]
section defines the behavior of pager.
Key | Value | Default | Description |
---|---|---|---|
mode | Auto, Always, Disable | Auto | The default behavior of pager usage without--pager commandline option |
detect_width | true, false | false | Whetherauto mode detects terminal width overflow |
use_builtin | true, false | false | Whether built-in pager is used |
command | [Command] | less -SR | Pager command |
Ifmode
isAuto
, pager is used only when output lines exceed terminal height.Default pager isless -SR
( ifless
is not found,more -f
).
About
A modern replacement for ps written in Rust
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.