The rarfile cannot be decompressed normally in linux. If you want to decompress the rarfile in linux, you must first install a rarlinux software in the system.
Install rarlinux
Wget http://www.rarsoft.com/rar/rarlinux-4.0.1.tar.gz
Tar-zxvf rarlinux-4.0.1.tar.gz
Cd rar
Make
The following information indicates that the installation is successful.
Mkdir-p/usr/local/bin
Mkdir-p/usr/local/lib
Cp rar unrar/usr/local/bin
Cp rarfiles. lst/etc
Cp default. sfx/usr/local/lib
Remember two Common commands:
Use rarlinux
The commands and parameters of rar and unrar are used in a variety of ways. The following describes only common command combinations. For more usage and instructions, refer to the commands rar -- help and unrar -- help.
Decompress the file
Unrar t <rar_file> command to test the file to be decompressed -- only test whether the compressed file is normal and the actual decompression operation is not performed
Unrar t test.rar
Unrar e <rar_file> command to decompress the compressed file to the current directory -- the following command decompress the content of the test.rar compressed package to the current directory
Unrar e test.rar
Unrar x <rar_file> <directory>
Command to decompress the compressed file to the specified directory-the following command decompress the test.rar compressed file to the/tmp/test/directory
Unrar x test.rar/tmp/test/
Package the file into a compressed file
In Linux, data is rarely packaged as RAR compressed files, because there are too many data packages and exchanges between Linux and Unix. However, to facilitate data transfer with Windows users, you still need to use rarlinux to create. rar compressed files.
Use rarlinux to format the command for creating a. rar file: rar a <compressed file name> <file1> <file2>... <fileN>
The following example compresses the image and css directories and index. php files into backup.rar files.
Rar a backup.rar image/css/index. php
The following command compresses all. php and. html files into web.rar files
Rar a web.rar *. php *. html