Rusht
Small shell utilities coded in Rust.
Install
Clone, build and install:
git clone https://github.com/mverleg/rusht /tmp/rusht || cd /tmp/rusht ; git pull
cargo install --bins --all-features --path /tmp/rusht
Or in minified mode:
RUSTFLAGS="-C target-cpu=native" cargo +nightly install -Z build-std=std,panic_abort --target "$(rustc -vV | grep host | sed -E 's/.*: (.*)/\1/')" --path .
Tools
Each of these has its own --help for more info
Top
cachedCache the output of a command for a given duration, running it only if there is no cache or it has expired. Stderr is only shown on first run.uniqueRemove any duplicate lines, keeping the first match and preserving order unless sorting is requested.namesafeConvert each line to a string that is safe for names (no whitespace or special characters, not too long).monLog the command, the outcome, timings and play a sound.grabFilter lines by regular expression, keeping only the matching capture group.dir_with/files_withFind directories or files that contain certain files or directories.
Other
cmadd,cmdo,cmlist,cmdrop- push commands onto a stack, directly or from output, and run them one by one or all at once.cmbufRead input, build commands and buffer them, then run them all. Somewhat like xargs. See also cmadd, cmdo, cmlist, cmdropdir_withFind directories that contain certain files or directories.files_withFind files that match certain patterns.uniqueRemove any duplicate lines, keeping the first match and preserving order unless sorting is requested.filterRun a test command for each line, keeping the file if the command succeedspompParse a tiny subset of pomfiles.pipedSplit into two commands, and pipe the output of the first into the second.batchedSplit stdin into groups of N lines, and pass them to the commandjlA mix of ls and find that outputs json (use jq)betweenSelect all lines between two matches