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
See the following information is installed successfully
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 first:
Using Rarlinux
RAR and Unrar command and parameter usage is various, the following only introduces some commonly used command combinations, more detailed usage and instructions please refer to the command RAR--help and Unrar--help
Extracting files
Unrar T <rar_file> command test the files to extract--test only the compressed file is normal, do not do the actual decompression operation
Unrar T Test.rar
Unrar e <rar_file> to extract compressed files to the current directory--The following command extracts the contents of the Test.rar compressed package into the current directory
Unrar e Test.rar
Unrar x <rar_file> <directory>
The command extracts the compressed file to the specified directory--The following command extracts the Test.rar compressed file into the/tmp/test/directory
Unrar x test.rar/tmp/test/
Package a file as a compressed file
There is little need to package data into a RAR compressed file under Linux because there are too many forms of data packaging and swapping between Linux and Unix. However, to facilitate the transfer of data with Windows users, learn to use Rarlinux to make. rar compressed files are still needed.
Using Rarlinux, the command format for the. rar file is: RAR a < compressed filename > <file1> <file2> ... <fileN>
The following example compresses image and CSS catalogs, as well as index.php files, into Backup.rar files
RAR a Backup.rar image/css/index.php
The following command compresses all the. php and. html files into Web.rar files
RAR a web.rar *.php *.html