Article title: Linux file compression tool Guide. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Author: Jacek Artymiak
Evaluation of some free and practical tools
To use this guide, read the author's introduction and use indexes to jump to the section in the guide that explains the tools you need. If you like, you can also read all the content! We provide a reference link at the end of each section and a main list at the end of this guide.
File compression and decompression are one of the most useful creations in the history of computing, but the lack of portability and open tools is one of the most important obstacles to its role. As long as we exchange files with other users using Unix-like operating systems, we can use portable tools such as compress, gzip, and bzip2 (for links, see references ). But others in the world use a variety of specialized software-or even specialized compression algorithms-and the owner may never make them public.
This kind of development will be very dangerous. Imagine that in the future, we may not be able to decode important parts of archives because we use dedicated tools and algorithms when creating them, the operating systems and hardware where those tools run are gradually outdated and disappear. This is why we should use open source compression tools, or at least use commercial compression tools that are free of charge and well-documented algorithms. (Remember not to use any special enhancement .)
This article is a guide to using the. arc,. arj,. lzh (.lha?#.rar=.sit#.zip and. zoo files in Linux. I chose to discuss these special formats because the three most popular operating systems (MS-DOS, Microsoft Windows, and Mac OS) use them most often. The reason why I wrote this guide is to guide everyone to quickly find the right tool, rather than discussing the file compression technology in detail.
Finally, I would like to briefly describe the self-extracted files. Such files are often stored in real programs that contain compressed data. When you execute them, they unpackage and copy the data stored in the program body to any drive you specified. The only problem is that they cannot be used in Linux and there is no tool to extract them. In this case, the person who creates the archive needs to compress the archive as a general archive.
Now, let's talk about it first. I hope this guide will help you and look forward to your comments and suggestions.
. Arc
Files with. arc extensions are relatively rare. If you come across one, you can basically think that it was created using the old MS-DOS sae arc or PKware PKARC Archive Utility. This form of support in Linux is not very good, and it is difficult to expect to decompress these files on Linux machines. If you need to create a. arc file, try to run the original sae arc or PKware PKARC under DOSEMU or VMware (find them on the FTP server that carries the MS-DOS utility ).
To decompress the. arc file, use Aladdin Expander for Linux. When writing this article, Aladdin Expander can be obtained for free for public Beta testing purposes; it is still unknown whether it continues to be free.
To extract the. arc file, enter unstuff file. arc. -D is a useful option to specify the destination location of the extracted file. For example, unstuff-d =./home/james/incoming file. arc.
Note: To learn more about Aladdin Expander for Linux, read the section on the. sit file.
. Arj
Files with. arj extensions are created using the ARJ Software for MS-DOS and Windows ARJ utilities. Because ARJ is a shared-Ware program that cannot obtain source code for free, there is almost no tool that matches its functions on the Linux platform, which makes it quite difficult to use the. arj file.
As long as the ARJ file can be decompressed successfully, you are lucky enough. It is impossible to perform. arj compression on Linux, because there is no local compression tool for Linux to generate such files. (You can try to run the original ARJ software in DOSEMU or VMware, but this is not an easy-to-use solution at all ).
To extract the. arj file, use the unarj utility. It is slower than ARJ and less powerful than ARJ, but at least it can smoothly extract most. arj files. It can only extract files to the current working directory, list files, or test files.
To view the brief help page, enter unarj; for more detailed descriptions, see the unarj.doc file, which is typically located in the/usr/doc/unarj-2.43 directory.
Despite where to decompress. the arj file is selected by you. to avoid confusion of the main working directory, you should create a temporary subdirectory in the main directory to change the current working directory to the new directory, move the compressed file to the new directory and use unarj e archive. arj to decompress the problematic file.
For Linux, unarj can only extract all files at a time. individual files cannot be extracted from files. At least if the file already exists in the current working directory, you will not overwrite the file even if a file with the same name is found in the file. In addition, unarj does not support empty directories or self-extracting archives; the latter is a MS-DOS/Windows program that cannot run on Linux, but can run under DOSEMU or VMware.
The following are some other unarj options:
Unarj archive. arj or unarj l archive. arj -- list file content
Unarj t archive. arj -- test file
Unarj x archive. arj -- file extraction with path name
Note that the unarj option does not start with a minus sign.
If unarj fails to decompress the file, try Aladdin Expander for Linux (for more information, see section about. sit ). You can also have the creator of an archive use other tools (such as free gzip that can be used for a MS-DOS) to compress it. You may also need a simple. arj file to avoid using all advanced ARJ options, such as volumes, splitting files into several smaller parts, and self-extracting.
Why not use self-extracting ARJ files? These are MS-DOS-style executable files that cannot be run in Linux; they use different system libraries and their internal formats are also different from those required by Linux. It is possible to run a self-extracting ARJ file in DOSEMU or VMware.
Compression in the form of ARJ or JAR still cannot be used in Linux. according to the FAQ page of ARJ Software, we should not wait for Linux to be transplanted. If you know that any Linux tool can decompress the. jar file, please let me know.
You can download the unarj source code from the site of ARJ Software or the FTP server that carries the Linux release version you need. In addition, unarj is typically part of a basic Linux release, so it can be found on the main distribution CD-ROM. For a list of links to all Linux releases, see The Linux releases page.
. Lzh (. lha)
Files with the. lzh or. lha extension are compressed by the LHa, LHarc, or LHx compression utility. These utilities are developed by Y. Tagawa, H. Yoshizaki, Momozou, and Masaru Oki. These utilities have been transplanted to many operating systems and the files they are created with considerable portability. Mats andsson performed Linux porting.
Unlike gzip, the lha utility compresses multiple files. To compress a single file, enter lha a archive file. The files created by lha have the. lzh extension. If archive. lzh already exists in the current working directory, add the files compressed by lha to this existing file. The previous contents of archive. lzh are retained, unless it already contains a file with the same name, in this case, the old file will be replaced by the new file. This operation is blind, meaning that it does not check the time stamp of the file; make sure that only files with the updated time stamp can replace the older files in the file, in this case, use the u option instead of the option (for example, lha u archive file ).
When the person who receives the. lzh file complains that the file cannot be decompressed, try to use lha ag archive file or lha ao archive file. The g and o options indicate that lha uses conventional or lha-compatible archiving methods. If you only update an existing file, use u instead of.
It is as easy to archive multiple files as to archive a single file: Use Wildcards (for example, lha a archive files *) or enter the top-level directory of the storage file (for example, lha a archive directory ). All files and subdirectories are automatically stored in the file. The file replacement rules and the u option have the same effect on multiple files and a single file. The syntax used by wildcard is the same as that used in common shell.
The following are some other lha options:
L -- list the file content (for example, lha l archive. lzh)
V -- list the file content in the detailed format (for example, lha v archive. lzh)
T -- test file integrity (for example, lha t archive. lzh)
Note that the lha option does not start with a negative sign (-), and there should be no space between them. If you need a list of other options, enter lha.
Extracting the. lzh and. lha files is quite easy: you only need to enter lha e archive. lha. If you want
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service