LINUX下使用.rar格式的压缩文件

本文介绍了在Linux环境下如何使用unrar命令来解压.rar格式的压缩文件,并提供了常用命令组合示例。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

大家一般常用的压缩格式是.tar.gz    .zip等,国际通用的压缩文件格式是zip文件。今天在redhat下使用了windows下常用的.rar文件。用到的解压缩命令符是unrar,用法如下:

 

 

linux-i206-100:/root # unrar --help

 

UNRAR 3.51 freeware      Copyright (c) 1993-2005 Alexander Roshal

 

Usage:     unrar <command> -<switch 1> -<switch N> <archive> <files...>

               <@listfiles...> <path_to_extract/>

 

<Commands>

  e             Extract files to current directory

  l[t,b]        List archive [technical, bare]

  p             Print file to stdout

  t             Test archive files

  v[t,b]        Verbosely list archive [technical,bare]

  x             Extract files with full path

 

<Switches>

  -             Stop switches scanning

  ad            Append archive name to destination path

  ap<path>      Set path inside archive

  av-           Disable authenticity verification check

  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>       Include only specified file

  n@            Read file names to include from stdin

  n@<list>      Include files in specified list file

  o+            Overwrite existing files

  o-            Do not overwrite existing files

  ow            Save or restore file owner and group

  p[password]   Set password

  p-            Do not query password

  r             Recurse subdirectories

  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

  x@            Read file names to exclude from stdin

  x@<list>      Exclude files in specified list file

  y             Assume Yes on all queries

 

   常用的命令组合:unrar x  filename.rar path_to_extract 

   注意:如果你的压缩包里有子文件夹,那就不要用unrar e filename.rar,因为解压后压缩包里的文件不再按文件夹分级放在目标文件夹里,而是所有的文件全部放在目标文件夹这一层里面。

   一般系统默认安装了unrar,压缩的工具rar需要自己安装。

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值