Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

rush

> 数据库
Open source

A cross-platform command-line tool for executing jobs in parallel

1.1K stars0 likes3 views
WebsiteGitHub

About

A cross-platform command-line tool for executing jobs in parallel

rush -- a cross-platform command-line tool for executing jobs in parallel

rush is a tool similar to GNU parallel and gargs. rush borrows some idea from them and has some unique features, e.g., supporting custom defined variables, resuming multi-line commands, more advanced embeded replacement strings.

These features make rush suitable for easily and flexibly parallelizing complex workflows in fields like Bioinformatics (see examples).

Table of Contents

  • Features
  • Performance
  • Installation
  • Usage
  • Examples
  • Special Cases
  • Contributors
  • Acknowledgements
  • Contact
  • License

Features

Major:

  • Supporting Linux, OS X and Windows (not CygWin)!
  • Avoid mixed line from multiple processes without loss of performance, e.g. the first half of a line is from one process and the last half of the line is from another process. (--line-buffer in GNU parallel)
  • Timeout (-t), terminating the timed-out command and its child-process tree. (--timeout in GNU parallel)
  • Retry (-r). (--retry-failed --joblog in GNU parallel)
  • Safe exit after capturing Ctrl-C: Linux uses native SIGINT/SIGKILL signals; Windows uses Ctrl+C/Ctrl+Break followed by taskkill /T /F to terminate the process tree.
  • Continue (-c). (--resume --joblog in GNU parallel, sut it does not support multi-line commands, which are common in workflow)
  • awk -v like custom defined variables (-v). (Using Shell variable in GNU parallel)
  • Keeping output in order of input (-k). (Same -k/--keep-order in GNU parallel)
  • Exit on first error (-e): stop scheduling and clean up active child processes. (--halt 2 in GNU parallel)
  • Settable record delimiter (-D, default \n). (--recstart and --recend in GNU parallel)
  • Settable records sending to every command (-n, default 1). (-n/--max-args in GNU parallel)
  • Settable field delimiter (-d, default \s+). (Same -d/--delimiter in GNU parallel)
  • Practical replacement strings (like GNU parallel):
    • Input data
      • {}, full data. (Same in GNU parallel)
      • {n}, nth field in delimiter-delimited data. (Same in GNU parallel)
    • Job related
      • {#}, job ID. With --continue, its saved form is stable when input order changes. (Same replacement string as GNU parallel.)
      • {?}, threads per job, computed as max(1, CPUs / jobs). With --continue, its saved form stays stable when the job count changes. (Not directly supported in GNU parallel)
    • Directory and file
      • {/}, dirname. ({//} in GNU parallel)
      • {%}, basename. ({/} in GNU parallel)
      • {.}, remove the last file extension. (Same in GNU parallel)
      • {:}, remove all file extensions (Not directly supported in GNU parallel)
      • {^suffix}, remove suffix (Not directly supported in GNU parallel)
      • {@regexp}, capture submatch using regular expression (Not directly supported in GNU parallel). There's a limitation here: curly brackets can't be used in the regular expression.
    • Combinations
      • {%.}, {%:}, basename without extension
      • {2.}, {2/}, {2%.}, manipulate nth field
      • {file:}, {file:^_1}, remove all extensions of a preset variable (see below)
    • Special symbols
      • {{}}, {} itself
      • {{1,}}, data containing double quotes {1,}.
  • Preset variable (macro), e.g., rush -v p={^suffix} 'echo {p}_new_suffix', where {p} is replaced with {^suffix}. (Using Shell variable in GNU parallel)

Minor:

  • Dry run (--dry-run). (Same in GNU parallel)
  • Trim input data (--trim). (Same in GNU parallel)
  • Verbose output (--verbose). (Same in GNU parallel)

Note that the comparison between rush and GNU parallel might be outdated, as both tools might have improved. See Differences between rush and GNU parallel on GNU parallel site.

Performance

Performance of rush is similar to gargs, and they are both slightly faster than parallel (Perl) and both slower than Rust parallel (discussion).

Note that speed is not the #.1 target, especially for processes that last long.

Installation

rush is implemented in Go programming language, executable binary files for most popular operating systems are freely available in release page.

Method 0: Conda

Install conda, then run

conda install -c conda-forge rush

Or use mamba, which is faster.

mamba install -c conda-forge rush

Method 1: Download binaries

rush v0.10.0 Tip: run rush -V to check update !!!

OS Arch File, Download Count
Linux 32-bit rush_linux_386.tar.gz
Linux 64-bit rush_linux_amd64.tar.gz
Linux arm64 rush_linux_arm64.tar.gz
OS X 64-bit rush_darwin_amd64.tar.gz
OS X arm64 rush_darwin_arm64.tar.gz
Windows 32-bit rush_windows_386.exe.tar.gz
Windows 64-bit rush_windows_amd64.exe.tar.gz
Windows arm64 rush_windows_arm64.exe.tar.gz
OpenBSD 64-bit rush_openbsd_amd64.tar.gz
OpenBSD arm64 rush_openbsd_arm64.tar.gz
FreeBSD 64-bit rush_freebsd_amd64.tar.gz
FreeBSD arm64 rush_freebsd_arm64.tar.gz

Just download compressed executable file of your operating system, and decompress it with tar -zxvf *.tar.gz command or other tools. And then:

  1. For Linux-like systems

    1. If you have root privilege simply copy it to /usr/local/bin:

      bash
       sudo cp rush /usr/local/bin/
      
    2. Or copy to anywhere in the environment variable PATH:

       mkdir -p $HOME/bin/; cp rush $HOME/bin/
  2. For windows, just copy rush.exe to C:\WINDOWS\system32.

Method 2: For Go developer

go install github.com/shenwei356/rush@latest

Method 3: Compiling from source

bash
# download Go from https://go.dev/dl
wget https://go.dev/dl/go1.25.5.linux-amd64.tar.gz

tar -zxf go1.25.5.linux-amd64.tar.gz -C $HOME/

# or 
#   echo "export PATH=$PATH:$HOME/go/bin" >> ~/.bashrc
#   source ~/.bashrc
export PATH=$PATH:$HOME/go/bin

git clone https://github.com/shenwei356/rush
cd rush

go build

# or statically-linked binary
CGO_ENABLED=0 go build -tags netgo -ldflags '-w -s'

# or cross compile for other operating systems and architectures
CGO_ENABLED=0 GOOS=openbsd GOARCH=amd64 go build -tags netgo -ldflags '-w -s'

Usage

…

Examples

  1. Simple run, quoting is not necessary

     # seq 1 3 | rush 'echo {}'
     $ seq 1 3 | rush echo {}
     3
     1
     2
    
  2. Read data from file (-i)

     $ rush echo {} -i data1.txt -i data2.txt
    
  3. Keep output order (-k)

     $ seq 1 3 | rush 'echo {}' -k
     1
     2
     3
    
  4. Timeout (-t)

     $ time seq 1 | rush 'sleep 2; echo {}' -t 1
     [ERRO] run command #1: sleep 2; echo 1: time out
    
     real    0m1.010s
     user    0m0.005s
     sys     0m0.007s
    
  5. Retry (-r)

     $ seq 1 | rush 'python unexisted_script.py' -r 1
     python: can't open file 'unexisted_script.py': [Errno 2] No such file or directory
     [WARN] wait command: python unexisted_script.py: exit status 2
     python: can't open file 'unexisted_script.py': [Errno 2] No such file or directory
     [ERRO] wait command: python unexisted_script.py: exit status 2
    
  6. Input containing {} (since v0.10.0)

     $ echo "a attr{href}"="h4 text{}" | rush -T b -k -D "=" 'echo "{}"'
     a attr{href}
     h4 text{}
    
     $ echo -ne "a{},b{{}},c{d}" | rush -D , -k "echo {}"
     a{}
     b{{}}
     c{d}
    
  7. Output {} itself (since v0.7.0)

     $ echo abc | rush 'echo "{} {{}}"'
     abc {}
    
  8. Dirname ({/}) and basename ({%}) and remove custom suffix ({^suffix})

     $ echo dir/file_1.txt.gz | rush 'echo {/} {%} {^_1.txt.gz}'
     dir file_1.txt.gz dir/file
    
  9. Get basename, and remove last ({.}) or any ({:}) extension

     $ echo dir.d/file.txt.gz | rush 'echo {.} {:} {%.} {%:}'
     dir.d/file.txt dir.d/file file.txt file
    
  10. Job ID, combine fields index and other replacement strings

     $ echo 12 file.txt dir/s_1.fq.gz | rush 'echo "job {#}: {2} {2.} {3%:^_1}"'
     job 1: file.txt file s
     
  11. Combine {#} with -c/--continue.

     $ seq 5 | rush 'tim

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gobioinformaticscommandcross-platformexecute

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库