!DOCTYPE html>
Update on November 12, 2023
"tar" stands for tape archive.
The tar command can compress or decompress files and folders. The compressed file is referred to as a tarball.
To compress a file or folder with gz compression:
To extract the tarball:
To compress a file or folder with xz compression:
To extract this tarball:
When decompressing a tarball, tar is intelligent enough to determine how the files were compressed. So, the following will decompress either type of tarball:
xz compression will produce smaller files than gzip, but it takes more time to compress and decompress the files.
Linux also has the commands zip and unzip:
zip does not preserve the ownership and permissions of files!
Rar is often used to split a large file (video) into smaller files.
unrar is usually not installed by default. To install it on Debian:
sudo apt install unrar
To unrar and merge the files: