linux下使用unrar命令解压*.rar格式文件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux下使用unrar命令解压*.rar格式文件相关的知识,希望对你有一定的参考价值。

  1. 下载

    http://www.rarlab.com/download.html下载相应的版本

  2. 安装

    [[email protected] ~]$ cat /etc/redhat-release
    Fedora release 24 (Twenty Four)
    [[email protected] ~]$ uname -r
    4.8.15-200.fc24.x86_64

    tar zxvf rarlinux-x64-5.4.0.tar.gz
    cd rar
    make
    make install 


  3. 使用帮助

    [[email protected] ~]$ unrar

    UNRAR 5.40 freeware      Copyright (c) 1993-2016 Alexander Roshal

    Usage:     unrar <command> -<switch 1> -<switch N> <archive> <files...>
                   <@listfiles...> <path_to_extract\>

    <Commands>
      e             Extract files without archived paths
      l[t[a],b]     List archive contents [technical[all], bare]
      p             Print file to stdout
      t             Test archive files
      v[t[a],b]     Verbosely list archive contents [technical[all],bare]
      x             Extract files with full path

    <Switches>
      -             Stop switches scanning
      @[+]          Disable [enable] file lists
      ad            Append archive name to destination path
      ag[format]    Generate archive name using the current date
      ai            Ignore file attributes
      ap<path>      Set path inside archive
      c-            Disable comments show
      cfg-          Disable read configuration
      cl            Convert names to lower case
      cu            Convert names to upper case
      dh            Open shared files
      ep            Exclude paths from names
      ep3           Expand paths to full including the drive letter
      f             Freshen files
      id[c,d,p,q]   Disable messages
      ierr          Send all messages to stderr
      inul          Disable all messages
      kb            Keep broken extracted files
      n<file>       Additionally filter included files
      [email protected]            Read additional filter masks from stdin
      [email protected]<list>      Read additional filter masks from list file
      o[+|-]        Set the overwrite mode
      ol[a]         Process symbolic links as the link [absolute paths]
      or            Rename files automatically
      ow            Save or restore file owner and group
      p[password]   Set password
      p-            Do not query password
      r             Recurse subdirectories
      sc<chr>[obj]  Specify the character set
      sl<size>      Process files with size less than specified
      sm<size>      Process files with size more than specified
      ta<date>      Process files modified after <date> in YYYYMMDDHHMMSS format
      tb<date>      Process files modified before <date> in YYYYMMDDHHMMSS format
      tn<time>      Process files newer than <time>
      to<time>      Process files older than <time>
      ts<m,c,a>[N]  Save or restore file time (modification, creation, access)
      u             Update files
      v             List all volumes
      ver[n]        File version control
      vp            Pause before each volume
      x<file>       Exclude specified file
      [email protected]            Read file names to exclude from stdin
      [email protected]<list>      Exclude files listed in specified list file
      y             Assume Yes on all queries

4.例子

(1).查看rar包中的内容:

#unrar l *.rar

或者

#unrar v *.rar

 

(2)测试rar包是否能解压成功:

#unrar t *.rar

 

(3).解压到当前文件夹:

#unrar e *.rar

 

(4).解压到指定文件夹:

#unrar x *.rar /tmp


本文出自 “12423429” 博客,请务必保留此出处http://12433429.blog.51cto.com/12423429/1891966

以上是关于linux下使用unrar命令解压*.rar格式文件的主要内容,如果未能解决你的问题,请参考以下文章

在LINUX下 用JAVA如何解压rar文件

Linux CentOS 7.6 下 rar unrar的安装

linux ubuntu如何解压rar文件?unrar

LINUX怎么解压rar格式的文件,还有怎么安装软件

Linux解压rar文件

Linux下解压rar压缩包