Compressed Files
Compressing files π
Using target file extension π
Only tested and confirmed to work with:
.tar.xz
.tar.gz
tar -caf archive.tar.xz file1 file2 file3
Can be used with * to include all files in folder
tar -caf archive.tar.xz *
Specify compression π
Compression options π
-a, --auto-compress use archive suffix to determine the compression program
-j, --bzip2 filter the archive through bzip2
-J, --xz filter the archive through xz
--lzip filter the archive through lzip
--lzma filter the archive through xz
--lzop filter the archive through lzop
--zstd filter the archive through zstd
-z, --gzip, --gunzip, --ungzip filter the archive through gzip
Example π
tar -cf archive.tar.xz file1 file2 file3 --xz
Extracting files π
TAR π
tar -xf archive.tar.xz
Tar relevant switches π
Taken from help message
-x, --extract, --get extract files from an archive
-c, --create create a new archive
-f, --file=ARCHIVE use archive file or device ARCHIVE
-a, --auto-compress use archive suffix to determine the compression program
-z, --gzip, --gunzip, --ungzip filter the archive through gzip
-v, --verbose verbosely list files processed
Zip π
unzip archive.zip
Uncompress .Z files π
Source: https://www.linuxfordevices.com/tutorials/linux/uncompress-z-file
uncompress archive.z
or
gzip -d archive.z