procs

procs is a replacement for ps written by Rust.

Build Status Crates.io codecov

Features

Platform

Linux is supported only.

Installation

Download binary

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

Cargo

You can install by cargo.

cargo install procs

Usage

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, Docker by default.

console $ procs zsh

procs_zsh

Search by numeric keyword

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

console $ procs 6000 60000 60001 16723

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.

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

Pager

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

Configuration

You can change configuration by ~/.procs.toml like below. The complete example of ~/.procs.toml can be generated by --config option.

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

[[columns]] kind = "Username" style = "BrightGreen" numericsearch = false nonnumericsearch = true

[style] header = "BrightWhite" unit = "BrightWhite"

[style.bypercentage] color000 = "BrightBlue" color025 = "BrightGreen" color050 = "BrightYellow" color075 = "BrightRed" color100 = "BrightRed"

[style.bystate] colord = "BrightRed" colorr = "BrightGreen" colors = "BrightBlue" colort = "BrightCyan" colorz = "BrightMagenta" colorx = "BrightMagenta" colork = "BrightYellow" colorw = "BrightYellow" colorp = "BrightYellow"

[style.byunit] colork = "BrightBlue" colorm = "BrightGreen" colorg = "BrightYellow" colort = "BrightRed" colorp = "BrightRed" color_x = "BrightBlue"

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

[display] showself = false 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. kind is column type and style is column color. numeric_search and nonnumeric_search mean whether this column can be matched by numeric/non-numeric search keyword. The available list of kind and style is below.

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

kind list

| procs kind | ps STANDARD FORMAT | Description | | ------------ | --------------------- | -------------------------------- | | Command | args | Command with all arguments | | CpuTime | cputime | Cumulative CPU time | | Eip | eip | Instruction pointer | | Esp | esp | Stack pointer | | Docker | -not supported- | Docker container name | | MajFlt | majflt | Major page fault count | | MinFlt | minflt | Minor page fault count | | Nice | ni | Nice value | | Pid | pid | Process ID | | Ppid | ppid | Parent process ID | | Priority | pri | Priority | | Processor | psr | Currently assigned processor | | ReadBytes | -not supported- | Read bytes from storage | | RtPriority | rtprio | Real-time priority | | Separator | -not supported- | Show | for column separation | | StartTime | start_time | Starting time | | State | s | Process State | | TcpPort | -not supported- | Binded TCP ports | | Threads | nlwp | Thread count | | Tty | tty | Controlling TTY | | UdpPort | -not supported- | Binded UDP ports | | UsageCpu | %cpu | CPU utilization | | UsageMem | %mem | Memory utilization | | Username | euser | User name | | VmData | -not supported- | Data size | | VmExe | trs | Text segments size | | VmHwm | -not supported- | Peak resident set size | | VmLib | -not supported- | Library code size | | VmLock | -not supported- | Locked memory size | | VmPeak | -not supported- | Peak virtual memory size | | VmPin | -not supported- | Pinned memory size | | VmPte | -not supported- | Page table entries size | | VmRss | rss | Resident set size | | VmSize | vsz | Physical page size | | VmStack | -not supported- | Stack size | | VmSwap | -not supported- | Swapped-out virtual memory size | | Wchan | wchan | Process sleeping kernel function | | WriteByte | -not supported- | Write bytes to storage |

style list

[style] section

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

color list

[style.by_*] section

[style.by_*] section defines colors of special styles like ByPercentage, ByState, ByUnit. The available list of color is the same as the list of [style] section.

[search] section

[search] section defines match policy. Policy can be Exact or Partial.

[display] section

[display] section defines option for display. show_self means whether the self ( procs ) process is shown. cut_to_* means whether output lines is truncated upto terminal size. color_mode means the default behavior of output coloring without --color commandline option. This can be Auto, Always or Disable.

[sort] section

[sort] section defines the column used for sort and sort order. If column is 0, value is sorted by left column. order can be Ascending or Descending.

[docker] section

[docker] section defines how to communicate to docker daemon. path means UNIX domain socket to docker daemon.

[pager] section

[pager] section defines the behavior of pager. mode means the default behavior of pager usage without --pager commandline option. This can be Auto, Always or Disable. If Auto, pager is used only when output lines exceed terminal height. Default pager is less -SR ( if less is not found, more -f ), but you can specify pager comand like below:

.procs.toml [pager] mode = "Auto" command = "less"

If more is used, -f option is recommended.

.procs.toml [pager] mode = "Auto" command = "more -f"