Although the other answers address point-and-click file compression solutions for Mac and Windows, there are options available for command-line file compression in Linux, Mac, and Windows (the latter using Windows Services for Linux, WSL). Command-line operations have the advantage of being able to be scripted. In addition to the PKzip format, other compression and archiving methods are available, using the Unix/Linux zip and bzip formats, along with the Tape ARchiver, (tar) utility In Linux, to compress to Zip format (compatible with Windows 7zip, PKzip, or WinZip) on the command line, install the zip and unzip packages if not already installed, using the package manager for your system (apt, yum, dnf, zypper, pacman, etc.) To check if installed, type âwhich zipâ on the command line. In a terminal window, type. zip ziparchivename.zip filetobezipped ⊠with the appropriate names. multiple files or wildcard patterns can be specified. The original files are retained. To compress a single file with GNU zip (not compatible with the Zip format), use. gzip filetobecompressed the original file will be removed and replaced with âfiletobecompressed.gzâ. gunzip will expand the .gz file to the original form and name. To create a multi-file compressed archive or archive of a directory, use the âtarâ command to create the archive, with the -z option to compress the archive. common gzipped naming conventions are â.tar.gzâ or â.tgzâ The original files are unchanged. tar -czf archivename.tgz filestobearchived ⊠Files are extracted from tar archives with the -x option, replacing the -c option. The archive is unchanged. GNU zip and tar formats are not compatible with PKzip/WinZip/7zip format. Although both compression and archiving formats can be used to exchange data between systems, it should be noted that file names in Unix/Linux/MacOS are case-sensitive, while file names in Windows are not, by default. An archive in either format created in a Unix-like system can contain the files âFile1.txtâ and âfile1.TXTâ, but if both are extracted on Windows, âfile1.TXTâ will overwrite âFile1.txtâ, since Windows (unmodified) considers them the same file. If you are running a Windows 10 build later than 2018, you can, with a command-line utility, turn on case-sensitivity for designated folders in NTFS, folder by folder, a feature needed for WSL to work properly. The case-sensitive attribute is not inheritable by subdirectories, nor is it applicable to external drives and devices with any of the FAT type file systems.
The best compression techniques are not “black-and-white” solutions that favor some compression algorithms over others. There are two common types of compression: One is the use of a specific algorithm (e.g. a dictionary or an AES encryption) as the basis for the compression. Another is the use of a pre-defined list of optimization techniques (e.g. Huffman codes, Huffman trees, or dictionary compression). Huffman coding — Wikipedia Huffman encoding is a common compression technique found in most dictionary compression algorithms. A Huffman tree is a tree-based structure for compressed data that is optimized for compactness, especially in terms of key space, and therefore provides reasonable scalability. Wikipedia provides several examples of Huffman code-length tables. Practical Huffman codes are found in Microsoft MSN articles. The Huffman code for the .PDF file is shown below. It defines a list of 7 code prefixes (or codes), which correspond to the “key”.