• 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
  • 相关阅读:
    部署openstack的官网文档解读mysql的配置文件
    ubuntu14.04行更新软件包
    Ubuntu14.04上修改主机名
    ubuntu上修改root密码
    在ISE查看各个模块消耗的资源
    132
    Aurora 8B/10B、PCIe 2.0、SRIO 2.0三种协议比较
    NAND flash和NOR flash的区别详解
    FPGA三分频,五分频,奇数分频
    以太网之物理层
  • 原文地址:https://www.cnblogs.com/liujiaxin2018/p/16063187.html
Copyright © 2020-2023  润新知