👨💻 about me home CV/Resume News 🖊️ Contact Codeberg Github LinkedIn 🏆 Best of LuaX (tools) pub bang ypp panda lsvg ldc yreq Fizzbuzz Calculadoira TPG picfg Belenos (intro) 🔀 Git Repos
Made in Europe
minitar.lua is a minimal tar implementation in Lua,
based on LuaX.
minitar.lua is a lightweight and portable utility that
allows you to create, extract, and test tar archives. It supports
multiple compression formats (gzip, lzip, xz) and offers path
manipulation features during archiving or extraction.
gzip for gzip compressionxz for xz compressionlzip is provided by LuaX. No external dependency is
required for the lzip compression.
Download the sources, compile and install minitar:
$ git clone https://codeberg.org/cdsoft/minitar.lua
$ cd minitar.lua
$ bang && ninja installminitar [-h] [-v] [-c] [-x] [-t] [-f archive] [--strip path]
[--add path] [-C path] [<file>] ... [--gzip [level]]
[--lzip [level]] [--xz [level]]
| Argument | Description |
|---|---|
<file> |
List of files to archive, extract or test |
| Option | Description |
|---|---|
-h, --help |
Display help and exit |
-v |
Verbose mode (displays detailed information) |
-c |
Create archive |
-x |
Extract archive |
-t |
Test archive (list its contents) |
-f archive |
Specify archive filename |
| Option | Description |
|---|---|
--strip path |
Remove path components during archiving or extraction |
--add path |
Add path components during archiving or extraction |
-C path |
Change directory before archiving or extracting |
| Option | Description |
|---|---|
--gzip [level] |
Compress with gzip (optional compression level) |
--lzip [level] |
Compress with lzip (optional compression level) |
--xz [level] |
Compress with xz (optional compression level) |
The compression format can be deduced from the output filename. These
options are necessary to change the default compression level
(6) or to compress a stream to the standard output
(stdout).
Create a simple tar archive:
minitar -c -f archive.tar file1 file2 folder1Create a tar archive compressed with gzip:
minitar -c -f archive.tar.gz file1 file2 folder1 --gzipCreate a tar archive compressed with xz (compression level 9):
minitar -c -f archive.tar.xz file1 file2 folder1 --xz 9Create an archive after changing directory:
minitar -c -f archive.tar -C /path/to/folder file1 file2Extract a tar archive:
minitar -x -f archive.tarExtract a compressed tar archive (format is automatically detected):
minitar -x -f archive.tar.gzExtract an archive to a specific directory:
minitar -x -f archive.tar -C /path/to/destinationExtract an archive removing the first two directory levels:
minitar -x -f archive.tar --strip 2Display the contents of a tar archive:
minitar -t -f archive.tarDisplay the contents of a compressed tar archive:
minitar -t -f archive.tar.xzThe --strip option allows you to remove path components
during archiving or extraction.
Example: If a file in the archive has the path
dir1/dir2/dir3/file.txt, then:
--strip 1 will result in
dir2/dir3/file.txt--strip 2 will result in
dir3/file.txt--strip 3 will result in file.txtThe --add option allows you to add a prefix to paths
during archiving or extraction.
Example: If a file has the path file.txt, then:
--add prefix will result in
prefix/file.txtminitar.lua supports several compression formats:
The compression format is automatically detected during extraction based on the file extension:
.tar.gz or .tgz for gzip.tar.lz or .tlz for lzip.tar.xz or .txz for xzminitar.lua is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
minitar.lua is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with minitar.lua. If not, see <https://www.gnu.org/licenses/>.
For further information about minitar.lua you can visit
https://codeberg.org/cdsoft/minitar.lua
This site is powered by LuaX, bang, ypp, cdsoft.css and Pandoc.
Mirrors: cdelord.fr – christophe.delord.free.fr – cdsoft.codeberg.page