procs

procs is a replacement for ps written in Rust.

Actions Status codecov

Changelog Crates.io procs homebrew

Documentation quick links

Features

Platform

Installation

Download binary

Download from release page, and extract to the directory in PATH.

Packaging status

Nixpkgs

You can install from Nixpkgs.

nix-env --install procs

snapcraft

You can install from snapcraft.

sudo snap install procs

homebrew

You can install from homebrew.

brew install procs

MacPorts

You can install from MacPorts.

sudo port install procs

Alpine Linux

You can install from the Alpine Linux repository.

The correct repository (see above link for the most up-to-date information) should be enabled before apk add.

sudo apk add procs

Arch Linux

You can install from the Arch Linux community repository.

sudo pacman -S procs

Scoop

You can install with scoop.

scoop install procs

Fedora

sudo dnf install procs

RPM

You can install with rpm.

sudo rpm -i https://github.com/dalance/procs/releases/download/v0.14.0/procs-0.14.0-1.x86_64.rpm

Cargo

You can install with cargo.

cargo install procs

Installation Notes

Permissions issues

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 use sudo.

console $ sudo procs [sudo] password for ...:

If you want to skip password input, you can add the following entry to /etc/sudoers.

text [user or group] ALL= NOPASSWD: [procs binary path] // ex. myuser ALL= NOPASSWD: /usr/local/bin/procs

Usage

In the following screenshots, config/large.toml is used as the configuration.

Show all processes

Type procs only. It shows the information of all processes.

console procs

procs

Search by non-numeric keyword

If you add any keyword as argument, it is matched to USER, Command by default.

console procs zsh

If you want to add columns matching to non-numeric keyword, nonnumeric_search option can be used in configuration file.

procs_zsh

Search by numeric keyword

If a numeric is used as the keyword, it is matched to PID by default. Numeric is treated as exact match, and non-numeric is treated as partial match by default.

console 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.

procs_port

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.

Logical operation of search keywords

If there are some keywords, logical operation between the keywords can be specified by commandline option.

The default operation can be specified in the configuration file. See [search] section.

Show Docker container name

If you have access permission to docker daemon ( unix:///var/run/docker.sock ), Docker column is added.

console procs growi

procs_docker

Note that procs gets the container information through UNIX domain socket, so Docker Toolbox on macOS (doesn't use UNIX domain socket) is not supported. Docker Desktop for Mac is supported but not tested.

Pager

If output lines exceed terminal height, pager is used automatically. This behavior and pager command can be specified by configuration file.

Linux / macOS

On Linux and macOS, less is the default pager. If there is not less, more is used. Instead of them, built-in pager can be used by configuration use_builtin.

Windows

On Windows, built-in pager is always used.

Watch mode

If --watch or --watch-interval <second> option is used, procs automatically updates output like top. 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.

Tree view

If --tree option is used, processes are sorted by dependency order and dependency tree is shown at left side.

console procs --tree

procs_tree

If TreeSlot column exists in config, dependency tree is shown at the slot.

Sort column

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 by CpuTime with ascending order. If --sortd rss, column is sorted by VmRss with descending order. The keyword is matched partially and case is ignored.

The default sort is specified by [sort] section in the configuration file.

console procs --sortd cpu

procs_sort

Insert column

--insert option inserts new column to the position of Slot column or MultiSlot column. The column for insert is selected by the option keyword. The keyword is the same as sort option. A Slot column can be used by an inserted column. If many insertions are required, many Slot columns should be added. A MultiSlot column can be used by many inserted columns. If there is a MultiSlot, all the remaining columns are inserted to the MultiSlot, and the subsequent Slot / MultiSlot is not used. Unused Slot / MultiSlot is not shown.

Shell completion

--gen-completion option generates shell completion files under the current directory. The following shells are supported.

--gen-completion-out option generates shell completion to stdout. You can source it directly on some shells.

console source <(procs --gen-completion-out bash)

Configuration

Configuration path

You can change configuration by writing a configuration file. There are some configuration examples in config directory of this repository. config/large.toml is the default configuration before procs v0.9.21.

The location of the configuration file is OS-specific:

For compatibility, if ~/.procs.toml exists, it will be preferred to the OS-specific locations.

Specify a configuration from command line

--use-config option can specify a built-in configuration. --load-config option can specify a configuration file path.

Configuration example

The complete example of a configuration file can be generated by --gen-config option.

```toml [[columns]] kind = "Pid" style = "BrightYellow|Yellow" numericsearch = true nonnumericsearch = false

[[columns]] kind = "Username" style = "BrightGreen|Green" numericsearch = false nonnumericsearch = true align = "Right"

[style] header = "BrightWhite|Black" unit = "BrightWhite|Black" tree = "BrightWhite|Black"

[style.bypercentage] color000 = "BrightBlue|Blue" color025 = "BrightGreen|Green" color050 = "BrightYellow|Yellow" color075 = "BrightRed|Red" color100 = "BrightRed|Red"

[style.bystate] colord = "BrightRed|Red" colorr = "BrightGreen|Green" colors = "BrightBlue|Blue" colort = "BrightCyan|Cyan" colorz = "BrightMagenta|Magenta" colorx = "BrightMagenta|Magenta" colork = "BrightYellow|Yellow" colorw = "BrightYellow|Yellow" colorp = "BrightYellow|Yellow"

[style.byunit] colork = "BrightBlue|Blue" colorm = "BrightGreen|Green" colorg = "BrightYellow|Yellow" colort = "BrightRed|Red" colorp = "BrightRed|Red" color_x = "BrightBlue|Blue"

[search] numericsearch = "Exact" nonnumericsearch = "Partial" logic = "And"

[display] showself = false showthread = false showthreadintree = true cuttoterminal = true cuttopager = false cuttopipe = false colormode = "Auto"

[sort] column = 0 order = "Ascending"

[docker] path = "unix:///var/run/docker.sock"

[pager] mode = "Auto" ```

[[columns]] section

[[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 | See kind list | | Column type | | style | See style list | | Column style | | numericsearch | true, false | false | Whether the column can be matched with numeric keywords | | nonnumericsearch | true, false | false | Whether the column can be matched with non-numeric keywords | | align | Left, Right, Center | Left | Text alignment | | maxwidth | [Number] | | Maximum column width | | minwidth | [Number] | | Minimum column width | | header | [String] | | Alternate header description |

kind list

| procs kind | ps STANDARD FORMAT | Description | Linux | macOS | Windows | | ------------ | --------------------- | --------------------------------------------- | ----- | ----- | ------- | | Command | args | Command with all arguments | o | o | o | | ContextSw | -not supported- | Context switch count | o | o | | | CpuTime | cputime | Cumulative CPU time | o | o | o | | Docker | -not supported- | Docker container name | o | o | | | Eip | eip | Instruction pointer | o | | | | ElapsedTime | -not supported- | Elapsed time | o | o | o | | Env | e output modifier | Environment variables | o | | | | Esp | esp | Stack pointer | o | | | | FileName | comm | File name | o | | | | Gid | egid | Group ID | o | o | o | | GidFs | fgid | File system group ID | o | | | | GidReal | rgid | Real group ID | o | o | | | GidSaved | sgid | Saved group ID | o | o | | | Group | egroup | Group name | o | o | o | | GroupFs | fgroup | File system group name | o | | | | GroupReal | rgroup | Real group name | o | o | | | GroupSaved | sgroup | Saved group name | o | o | | | MajFlt | majflt | Major page fault count | o | o | o | | MinFlt | minflt | Minor page fault count | o | o | | | MultiSlot | -not supported- | Slot for --insert option | o | o | o | | Nice | ni | Nice value | o | o | | | Pgid | pgid | Process group ID | o | o | | | Pid | pid | Process ID ( or Thread ID sorrunded by [] ) | o | o | o | | Policy | policy | Scheduling policy | o | o | | | Ppid | ppid | Parent process ID | o | o | o | | Priority | pri | Priority | o | o | o | | Processor | psr | Currently assigned processor | o | | | | ReadBytes | -not supported- | Read bytes from storage | o | o | o | | RtPriority | rtprio | Real-time priority | o | | | | SecContext | label | Security context | o | | | | Separator | -not supported- | Show \| for column separation | o | o | o | | Session | sid | Session ID | o | o | | | ShdPnd | pending | Pending signal mask for process | o | | | | SigBlk | blocked | Blocked signal mask | o | | | | SigCgt | caught | Caught signal mask | o | | | | SigIgn | ignored | Ignored signal mask | o | | | | SigPnd | pending | Pending signal mask for thread | o | | | | Slot | -not supported- | Slot for --insert option | o | o | o | | Ssb | -not supported- | Speculative store bypass status | o | | | | StartTime | start_time | Starting time | o | o | o | | State | s | Process state | o | o | | | TcpPort | -not supported- | Bound TCP ports | o | o | | | Threads | nlwp | Thread count | o | o | | | TreeSlot | -not supported- | Slot for tree column | o | o | o | | Tty | tty | Controlling TTY | o | o | | | UdpPort | -not supported- | Bound UDP ports | o | o | | | Uid | euid | User ID | o | o | o | | UidFs | fuid | File system user ID | o | | | | UidLogin | -not supported- | Login user ID | o | | | | UidReal | ruid | Real user ID | o | o | | | UidSaved | suid | Saved user ID | o | o | | | UsageCpu | %cpu | CPU utilization | o | o | o | | UsageMem | %mem | Memory utilization | o | o | o | | User | euser | User name | o | o | o | | UserFs | fuser | File system user name | o | | | | UserLogin | -not supported- | Login user name | o | | | | UserReal | ruser | Real user name | o | o | | | UserSaved | suser | Saved user name | o | o | | | VmData | -not supported- | Data size | o | | | | VmExe | trs | Text segments size | o | | | | VmHwm | -not supported- | Peak resident set size | 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 | | VmSize | vsz | Physical page size | o | o | o | | VmStack | -not supported- | Stack size | o | | | | VmSwap | -not supported- | Swapped-out virtual memory size | o | | o | | Wchan | wchan | Process sleeping kernel function | o | | | | WorkDir | -not supported- | Current working directory | o | | | | WriteByte | -not supported- | Write bytes to storage | o | o | o |

style list

There are some special styles like ByPercentage, ByState, ByUnit. These are the styles for value-aware coloring. For example, if ByUnit is chosen, color can be specified for each unit of value ( like K, M, G,,, ). The colors can be configured in [style.by_unit] section.

Other colors can be configured as the same as color.

[style] section

[style] section defines colors of header, unit and each styles. The available list of color is below.

| Subsection | Key | Value | Default | Description | | ------------- | --------- | ---------------- | ---------------------- | -------------------- | | | header | See color list | BrightWhite\|Black | Header color | | | unit | See color list | BrightWhite\|Black | Unit color | | | tree | See color list | BrightWhite\|Black | Tree color | | bypercentage | color000 | See color list | BrightBlue\|Blue | Color at 0% - 25% | | bypercentage | color025 | See color list | BrightGreen\|Green | Color at 25% - 50% | | bypercentage | color050 | See color list | BrightYellow\|Yellow | Color at 50% - 75% | | bypercentage | color075 | See color list | BrightRed\|Red | Color at 75% - 100% | | bypercentage | color100 | See color list | BrightRed\|Red | Color at 100% - | | bystate | colord | See color list | BrightRed\|Red | Color at D state | | bystate | colorr | See color list | BrightGreen\|Green | Color at R state | | bystate | colors | See color list | BrightBlue\|Blue | Color at S state | | bystate | colort | See color list | BrightCyan\|Cyan | Color at T state | | bystate | colorz | See color list | BrightMagenta\|Magenta | Color at Z state | | bystate | colorx | See color list | BrightMagenta\|Magenta | Color at X state | | bystate | colork | See color list | BrightYellow\|Yellow | Color at K state | | bystate | colorw | See color list | BrightYellow\|Yellow | Color at W state | | bystate | colorp | See color list | BrightYellow\|Yellow | Color at P state | | byunit | colork | See color list | BrightBlue\|Blue | Color at unit K | | byunit | colorm | See color list | BrightGreen\|Green | Color at unit M | | byunit | colorg | See color list | BrightYellow\|Yellow | Color at unit G | | byunit | colort | See color list | BrightRed\|Red | Color at unit T | | byunit | colorp | See color list | BrightRed\|Red | Color at unit P | | byunit | colorx | See color list | BrightBlue\|Blue | Color at other unit |

color list

Colors can be configured by theme through |.

toml style = "BrightWhite|Black" # BrightWhite for dark theme and Black for light theme style = "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:

toml style = "223|112" # 223 for dark theme and 112 for light theme style = "223" # 223 for both theme

[search] section

[search] section defines option for Keyword search.

| Key | Value | Default | Description | | ----------------- | ----------------------------- | ------- | ------------------------------------------------------- | | numericsearch | Exact, Partial | Exact | Whether numeric keywords match exactly or partially | | nonnumericsearch | 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

case is case sensitivity in search.

[display] section

[display] section defines option for output display.

| Key | Value | Default | Description | | --------------------- | --------------------- | ---------------- | ---------------------------------------------------------------------------- | | showself | true, false | false | Whether the self process ( procs ) is shown | | showthread | true, false | false | Whether the thread information is shown ( Linux only ) | | showthreadintree | true, false | true | Whether the thread information is shown in tree mode ( Linux only ) | | showparentintree | true, false | true | Whether the parent process is shown in tree mode | | showchildrenintree | true, false | true | Whether the children processes are shown in tree mode | | showheader | true, false | true | Whether header row is shown | | showfooter | true, false | false | Whether footer row is shown | | cuttoterminal | true, false | true | Whether output lines are truncated for output into terminal | | cuttopager | true, false | false | Whether output lines are truncated for output into pager | | cuttopipe | true, false | false | Whether output lines are truncated for output into pipe | | colormode | 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 | | treesymbols | [String; 5] | [│, ─, ┬, ├, └] | Symbols used by tree view | | abbrsid | true, false | true | Whether machine SID is abbreviated ( Windows only ) | | theme | Auto, Dark, Light | Auto | Default theme |

If color_mode is Auto, color is enabled for terminal and pager, disabled for pipe.

If theme is Auto, theme is detected from terminal automatically. Some terminal don't support the automatic detection, so Dark or Light can be specified explicitly.

abbr_sid

Windows SID is too long, so it is abbreviated by default. If abbr_sid is false, SID is fully shown like below:

text S-1-5-21-789457439-2186958450-1652286173-1001

If abbr_sid is true, SID is shown like below:

text S-1-5-21-...-1001

[sort] section

[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 |

If column is 0, value is sorted by the left column.

[docker] section

[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

[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 | | detectwidth | true, false | false | Whether auto mode detects terminal width overflow | | usebuiltin | true, false | false | Whether built-in pager is used | | command | [Command] | less -SR | Pager command |

If mode is Auto, pager is used only when output lines exceed terminal height. Default pager is less -SR ( if less is not found, more -f ).