zoukankan      html  css  js  c++  java
  • ubuntu中如何解压rar文件

    1、问题

    ubuntu中解压rar文件, 如下:

    root@PC1:/home/test2# ls
    test.rar
    root@PC1:/home/test2# unrar e test.rar
    -bash: /usr/bin/unrar: No such file or directory

    2、解决方法, 安装unrar

    root@PC1:/home/test2# apt install unrar
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following NEW packages will be installed:
      unrar
    0 upgraded, 1 newly installed, 0 to remove and 98 not upgraded.
    Need to get 113 kB of archives.
    After this operation, 406 kB of additional disk space will be used.
    Get:1 http://cn.archive.ubuntu.com/ubuntu focal/multiverse amd64 unrar amd64 1:5.6.6-2build1 [113 kB]
    Fetched 113 kB in 5s (20.7 kB/s)
    Selecting previously unselected package unrar.
    (Reading database ... 219903 files and directories currently installed.)
    Preparing to unpack .../unrar_1%3a5.6.6-2build1_amd64.deb ...
    Unpacking unrar (1:5.6.6-2build1) ...
    Setting up unrar (1:5.6.6-2build1) ...
    update-alternatives: using /usr/bin/unrar-nonfree to provide /usr/bin/unrar (unrar) in auto mode
    Processing triggers for man-db (2.9.1-1) ...

    3、测试结果

    root@PC1:/home/test2# ls
    test.rar
    root@PC1:/home/test2# unrar e test.rar    ## unrar e rar文件 进行解压rar文件
    
    UNRAR 5.61 beta 1 freeware      Copyright (c) 1993-2018 Alexander Roshal
    
    
    Extracting from test.rar
    
    Extracting  test.txt                                                  OK
    All OK
    root@PC1:/home/test2# ls   ## 解压成功
    test.rar  test.txt

    4、如何压缩为rar文件?

    root@PC1:/home/test2# ls
    test.txt
    root@PC1:/home/test2# rar a file.rar test.txt
    -bash: /usr/bin/rar: No such file or directory
    root@PC1:/home/test2# ls
    test.txt

    5、安装rar

    root@PC1:/home/test2# apt install rar
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following NEW packages will be installed:
      rar
    0 upgraded, 1 newly installed, 0 to remove and 98 not upgraded.
    Need to get 295 kB of archives.
    After this operation, 799 kB of additional disk space will be used.
    Get:1 http://cn.archive.ubuntu.com/ubuntu focal/multiverse amd64 rar amd64 2:5.5.0-1build1 [295 kB]
    Fetched 295 kB in 6s (46.9 kB/s)
    Selecting previously unselected package rar.
    (Reading database ... 219908 files and directories currently installed.)
    Preparing to unpack .../rar_2%3a5.5.0-1build1_amd64.deb ...
    Unpacking rar (2:5.5.0-1build1) ...
    Setting up rar (2:5.5.0-1build1) ...
    Processing triggers for man-db (2.9.1-1) ...

    6、测试

    root@PC1:/home/test2# ls
    test.txt
    root@PC1:/home/test2# rar a file.rar test.txt   ## 压缩为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 file.rar
    
    Adding    test.txt                                                    OK
    Done
    root@PC1:/home/test2# ls    ## 压缩成功
    file.rar  test.txt
  • 相关阅读:
    一键搞定JavaEE应用,JRE+Tomcat+Mysql-JaveEE绿色运行环境JTM0.9版 (转载)
    java Timer 定时每天凌晨1点执行任务
    阿里云windows 2012服务器部署java web程序教程
    记录web项目部署到阿里云服务器步骤
    Javaweb程序打包或exe执行文件
    mysql常见的错误码
    java使用poi解析或处理excel的时候,如何防止数字变成科学计数法的形式和其他常见Excel中数据转换问题
    jsp实现文件下载的代码(转载)
    Java导出Excel表,POI 实现合并单元格以及列自适应宽度(转载)
    Tishreen-CPC 2018 G. Colors Overflow(分块)
  • 原文地址:https://www.cnblogs.com/liujiaxin2018/p/15700162.html
Copyright © 2011-2022 走看看