linux中rar文件的壓縮、解壓


1、測試數據

root@ubuntu01:/home/test# ls
outcome.map  outcome.ped
root@ubuntu01:/home/test# ll -h
total 80M
drwxr-xr-x 2 root root 4.0K 3月  27 15:58 ./
drwxr-xr-x 6 root root 4.0K 3月  27 14:36 ../
-rw-r--r-- 1 root root 1.3M 10月 15  2018 outcome.map
-rw-r--r-- 1 root root  79M 10月 19  2018 outcome.ped

 

2、壓縮為rar文件

root@ubuntu01:/home/test# ls
outcome.map  outcome.ped
root@ubuntu01:/home/test# rar a xxx.rar outcome.*    ## 壓縮為rar文件

RAR 5.50   Copyright (c) 1993-2017 Alexander Roshal   11 Aug 2017
Trial version             Type 'rar -?' for help

Evaluation copy. Please register.

Creating archive xxx.rar

Adding    outcome.map                                                 OK
Adding    outcome.ped                                                 OK
Done
root@ubuntu01:/home/test# ls
outcome.map  outcome.ped  xxx.rar
root@ubuntu01:/home/test# rar a -m5 yyy.rar outcome.*      ## 以最大壓縮率壓縮

RAR 5.50   Copyright (c) 1993-2017 Alexander Roshal   11 Aug 2017
Trial version             Type 'rar -?' for help

Evaluation copy. Please register.

Creating archive yyy.rar

Adding    outcome.map                                                 OK
Adding    outcome.ped                                                 OK
Done
root@ubuntu01:/home/test# ls
outcome.map  outcome.ped  xxx.rar  yyy.rar   ## 查看壓縮后大小的差異
root@ubuntu01:/home/test# ll -h
total 99M
drwxr-xr-x 2 root root 4.0K 3月  27 15:59 ./
drwxr-xr-x 6 root root 4.0K 3月  27 14:36 ../
-rw-r--r-- 1 root root 1.3M 10月 15  2018 outcome.map
-rw-r--r-- 1 root root  79M 10月 19  2018 outcome.ped
-rw-r--r-- 1 root root 9.7M 3月  27 15:59 xxx.rar
-rw-r--r-- 1 root root 9.1M 3月  27 16:00 yyy.rar

 

3、解壓rar文件

root@ubuntu01:/home/test# ls
xxx.rar
root@ubuntu01:/home/test# unrar e xxx.rar

UNRAR 5.61 beta 1 freeware      Copyright (c) 1993-2018 Alexander Roshal


Extracting from xxx.rar

Extracting  outcome.map                                               OK
Extracting  outcome.ped                                               OK
All OK
root@ubuntu01:/home/test# ls
outcome.map outcome.ped  xxx.rar

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM