LinuxCommandLibrary

lrztar

Compress and transfer files to a remote system

TLDR

Archive a directory with tar, then compress

$ lrztar [path/to/directory]
copy

Same as above, with ZPAQ - extreme compression, but very slow
$ lrztar -z [path/to/directory]
copy

Specify the output file
$ lrztar -o [path/to/file] [path/to/directory]
copy

Override the number of processor threads to use
$ lrztar -p [8] [path/to/directory]
copy

Force overwriting of existing files
$ lrztar -f [path/to/directory]
copy

SYNOPSIS

Although not a direct command, "lrztar" operations are commonly performed using tar with the -I lrzip option:

To create an lrztar archive:
tar -I lrzip -cvf <archive_name.tar.lrz> <path/to/files/or/directories>...

To extract from an lrztar archive:
tar -I lrzip -xvf <archive_name.tar.lrz>

PARAMETERS

-c, --create
    Create a new archive.

-x, --extract, --get
    Extract files from an archive.

-v, --verbose
    Verbosely list files processed (show progress).

-f, --file=<ARCHIVE>
    Use archive file <ARCHIVE>. For "lrztar", this is the .tar.lrz file.

-I, --use-compress-program=<PROGRAM>
    Filter the archive through <PROGRAM> (here, lrzip). This is the key option for "lrztar".

-p, --preserve-permissions
    Extract files preserving their original permissions (relevant for extraction).

--remove-files
    Remove source files after adding them to the archive (use with caution).

DESCRIPTION

The term "lrztar" is not a standard, standalone Linux command. It is a colloquial or conceptual term that typically refers to the process of creating or extracting TAR archives that have been compressed using the lrzip compression utility.

TAR (Tape ARchive) is a widely used archiving utility that bundles multiple files and directories into a single archive file, preserving file permissions, timestamps, and directory structures. It does not inherently provide compression.

lrzip is a highly efficient and fast compressor, often surpassing gzip, bzip2, and xz in compression ratio and speed, especially on multi-core systems due to its support for multithreading. It is a successor to the rzip compressor.

When users refer to "lrztar", they generally mean using tar with lrzip as its compression filter (e.g., via tar -I lrzip) or piping the output of tar to lrzip, to create archives with a high compression ratio. The resulting archive file typically has a .tar.lrz or .tlrz extension.

CAVEATS

"lrztar" is not a direct command; it refers to a specific usage pattern of tar and lrzip.
Both tar and lrzip utilities must be installed on the system for this operation to work.
Decompressing an .lrz archive requires the lrzip utility.
While lrzip offers high compression, it can be slower than gzip for very small files due to its more complex algorithms.

USAGE EXAMPLES

1. Create an lrztar archive of a directory:
tar -I lrzip -cvf my_archive.tar.lrz /path/to/my_directory

2. Extract an lrztar archive:
tar -I lrzip -xvf my_archive.tar.lrz

3. Pipe tar output to lrzip (alternative method for creation):
tar -cvf - /path/to/my_directory | lrzip -o my_archive.tar.lrz

4. Decompress an .lrz file (if not a .tar.lrz archive):
lrzip -d my_file.lrz

HISTORY

TAR (Tape Archive) originated in 1979 in Unix as a utility for archiving files to magnetic tape. It became a fundamental tool for file packaging and distribution on Unix-like systems.

lrzip is a relatively modern compression utility, developed by Con Kolivas. It emerged as a successor to rzip, designed to offer superior compression ratios and performance by leveraging modern CPU architectures, including multithreading. It gained popularity for its ability to achieve high compression while maintaining decent speeds, especially for large datasets where traditional compressors might struggle.

SEE ALSO

tar(1), lrzip(1), gzip(1), bzip2(1), xz(1)

Copied to clipboard