On windows, there is a convenient rar compression and decompression tool. in linux, whether as a PC or server, sometimes some rar compressed packages will be downloaded, we need to decompress it. By default, linux does not support rar. we need to install it separately. Therefore, we search for rar tools online. the following URL can download WinRAR, a well-known tool. Http://www.rarsoft.com/download.htm1
On windows, there is a convenient rar compression and decompression tool. in linux, whether as a PC or server, sometimes some rar compressed packages will be downloaded, we need to decompress it. By default, linux does not support rar. we need to install it separately. Therefore, we search for rar tools online. the following URL can download WinRAR, a well-known tool.
http://www.rarsoft.com/download.htm
We need to select the corresponding version based on our operating system and language. the default version is english. I chose a 64-bit installation package. after the download is complete, we will see the installation work.
// Under the Download directory of the current user [closure @ localhost Downloads] $ // view the downloaded installation package [closure @ localhost Downloads] $ lsrarlinux-x64-5.2.1.tar.gz // This is the installation package we downloaded // Unzip installation package [closure @ localhost Downloads] $ tar-zxvf rarlinux-x64-5.2.1.tar.gz // extract the installation package rar/order.htm rar/acknow.txt rar/readme.txt rar/rar_staticrar/default. sfxrar/license.txt rar/rarfiles. lstrar/whatsnew.txt rar/makefilerar/rarrar/unrarrar/rar.txt // enter the decompressed file directory [closure @ l Ocalhost Downloads] $ cd rar // compilation and installation (Permission error will be reported if sudo is not used) [closure @ localhost rar] $ sudo make [sudo] password for closure: mkdir-p/usr/local/binmkdir-p/usr/local/libcp rar unrar/usr/local/bincp rarfiles. lst/etccp default. sfx/usr/local/lib // check whether rar has been installed successfully. [closure @ localhost rar] $ rar // the information and usage of rar are listed here, which is skipped here, as you can see, there are many commands, and we only need to know the common operations.
Through the above operations, we have installed the rar tool. The following describes several common usage (command form ):
- Compress files and folders to a specified compressed package and save the original files.
rar a package.rar files...
For details, compress files to package.rar. files can include files and directories and keep the original files.
- Compress the file. after compression, delete the original file.
rar m package.rar files...
For details, the m command is only valid for files and is invalid for folders. if files contains folders, no processing is performed on the folders.
rar x package.rar [dir]
For details, keep the document structure unchanged under the same directory as the others.
- More operation methods can be obtained through the rar command