LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

zrun

Run commands on compressed files by auto-decompressing arguments

TLDR

Run command on compressed file
$ zrun [command] [file.gz]
copy
Run diff on two compressed files
$ zrun diff [file1.gz] [file2.gz]
copy
Run less on gzipped file
$ zrun less [file.gz]
copy

SYNOPSIS

zrun command [arguments]

DESCRIPTION

zrun transparently decompresses compressed file arguments to temporary files before passing them to the specified command. It detects which arguments are compressed files by their extension, decompresses only those to temporary files (not pipes), runs the command with the decompressed paths, then cleans up.This is useful for running commands that don't natively support compressed input without manual decompression steps.The following compression types are supported: gz, bz2, Z, xz, lzma, lzo.If zrun is symlinked to a name beginning with z (e.g., zprog), executing the link is equivalent to running zrun prog.

CAVEATS

Modifications to the uncompressed temporary file are not fed back into the input file, so using this as a way to make an editor support compressed files will not work.Large compressed files require temporary disk space for decompression.The command sees different (temporary) filenames than the originals, which may matter for some tools.

SEE ALSO

zcat(1), zless(1), zgrep(1), gzip(1), bzip2(1), xz(1)

Copied to clipboard
Kai