remux
A command line regex multiplexer for filtering and streaming lines to multiple targets.
Example
tail -f log.txt | remux ERROR errors.txt WARN warnings.txt INFO verbose.txt
Install
go get -u neilpa.me/remux
There are also pre-built static binaries for Windows, Mac and Linux on the releases tab.
Usage
remux [options] <regex0> [<file0> [<regex1> <file1> ...]]
By default, source data is streamed from STDIN
, use -i
to specify a file instead. The -i
argument can be set more than once to read from multiple input sources serially. If interleaved input is required, send through paste
first
An empty string or -
can be provided to -i
to explicitly use STDIN
. Similarly, an empty string or -
for an output file to use STDOUT
. Additionally, omitting the last file argument also implies STDOUT
as the target.
Alternatives
- Process substitution
- Explicit file descriptors
- Named pipes
pee
command inmoreutils
MULTIOS
option fromzsh