A collection of POSIX shell scripts to invoke archiver programs
(s)tar/gzip/bzip2/bzip3/xz/zip/7z/lzma/lrzip/arj/zoo/brotli/zopfli/zstd
Author: Martin Väth
This project is under the BSD license 2.0 (“3-clause BSD license”). SPDX-License-Identifier: BSD-3-Clause
These are some POSIX shell scripts which form an interface to various archiver programs like
- tar/star
- brotli
- zstd
- gzip/zopfli
- bzip2
- bzip3
- xz/lzma
- zip
- 7z
- lrzip
- arj
- zoo
For unpacking even some more formats are supported (if binaries are available).
It is in particular possible to invoke all archivers (keeping only the "best" result), to repack archives, pack to remote hosts etc. Note that also less popular archivers are supported.
A lot of options control the details; since the scripts are mainly written
for myself, they are not too well documented.
Use option -h to obtain help.
You need push.sh from https://github.com/vaeth/push (v2.0 or newer)
in your $PATH.
For installation. just put the content of bin somewhere in your $PATH.
Also put the files of the subdirectory zsh into your zsh's $fpath to obtain
zsh completion support. (If you do not have root access, you can add the
corresponding directory with fpath+=("...") before you
call compdef from your zsh initialization files).
If you do have root access it is recommended to put the files archwrap.sh
not into the $PATH (typically /usr/bin) but instead into
/usr/share/archwrap/ and to modify the line
. archwrap.sh
in the binaries into
. /usr/share/archwrap/archwrap.sh
If you do not want to put the symlinks into your path, you can
source the archwrap_alias file (in a shell understanding the alias command)
to obtain a similar effect in an interactive shell.
For installation under Gentoo, there is an ebuild in the mv repository
(available by app-select/eselect-repository or app-portage/layman).
A standard usage is as follows
-
-
ppddirectory(s) /pddirectory(s)Pack directory(s) with all subdirectories with all archiver programs (each directory is put into a separate archive) and keep only the "best" version. Lots of options control the details: Invoke
pd/ppdwithout any arguments for a list of them.ppd(in contrast topd) only attempts the most popular archivers. -
tgzddirectory(s) (actually uses zopfli unless-Qis specified) -
tbrddirectory(s) -
tbzddirectory(s) -
tlzddirectory(s) -
t7zddirectory(s) -
tlrddirectory(s) -
txzddirectory(s) -
tzsddirectory(s) -
tarddirectory(s) -
zipddirectory(s) -
gzipddirectory(s) (uses.tar.gzextension) -
brddirectory(s) (uses.tar.brextension) -
bzipddirectory(s) (uses.tar.bz2extension) -
lzmaddirectory(s) (uses.tar.lzmaextension) -
zstdddirectory(s) (uses.tar.zstextension) -
xzddirectory(s) (uses.tar.xzextension) -
7zddirectory(s) (uses.tar.7zextension) -
lrzddirectory(s) (uses.tar.lrzextension)Similarly as
ppdbut invokes only the corresponding archiver program. Different options are available, depending on the archiver program.
-
-
-
udARCHIVE(s) Generate the directory(s) ARCHIVE and unpack ARCHIVE.??? into it. This works for all archive formats (with proper name extension). Invokeudwithout any arguments for a complete list of options. -
uvARCHIVE(s) oruv -vARCHIVE(s)List content of ARCHIVE(s) (briefly or verbosely, respectively). This works for all supported archive formats whose archivers have corresponding options.
-
u -tARCHIVE(s)Test integrity of ARCHIVE(s). This works for all supported archive formats whose archivers have corresponding options.
-
-
2pdARCHIVE(s) or2ppdARCHIVE(s) First unpack ARCHIVE and then pack it again with all/popular archivers, keeping only the "best" version. Invoke2pdwithout any arguments for a complete list of options. -
tbzd -C -R - / | sshcat user@host:backup.tar.bz2Make a compressed backup of the whole filesystem to a file on a remote host.