Here is a quick config tip on how to compress and extract files using RAR archive utility. First let’s see how we can compress directory using RAR. In our example we have a directory called my_files containing five files:
$ mkdir my_files $ touch my_files/file{1..5} $ ls my_files/ file1 file2 file3 file4 file5
To compress entire directory using RAR archive tool we use rar’s a
command. The below command will create a RAR archive called my_files.rar containing all five above files:
$ rar a my_files.rar my_files/ Creating archive my_files.rar Adding my_files/file5 OK Adding my_files/file4 OK Adding my_files/file3 OK Adding my_files/file2 OK Adding my_files/file1 OK Done $ ls -l my_files.rar -rw-rw-r--. 1 lrendek lrendek 307 Nov 3 06:55 my_files.rar