Linux之rar文件解壓之路

導讀 相信你們在使用Linux系統時有時候會碰到有關於rar文件的解壓縮。網上下載rar 壓縮文件的使用,在linux在咱們須要對其進行解壓縮,這個時候,咱們須要安裝 rar相關的文件,來進行解壓縮。

1. 下載html

咱們進入rarlab網站,進行下載 rar for linux x64linux

2. 使用 tar 命令 解壓 (*.tar 用 tar –xvf )app

➜  Downloads tar -xvf rarlinux-x64-5.6.0.tar.gz

3. 進入文件夾make (須要 管理員權限)less

➜  rar cat makefile 
###################################################################
# Installing RAR executables, configuration files and SFX modules #
# to appropriate directories                                      #
###################################################################

PREFIX=/usr/local

install:
    mkdir -p $(PREFIX)/bin
    mkdir -p $(PREFIX)/lib
    cp rar unrar $(PREFIX)/bin
    cp rarfiles.lst /etc
    cp default.sfx $(PREFIX)/lib%

若是不進行make 須要在命令所在的文件夾執行命令,或者把文件夾加入環境變量中。ide

4. 最後,能夠使用 unrar 進行解壓, 使用 rar 命令,進行壓縮。網站

➜  ~ unrar x [file]

咱們 能夠直接輸入 unrar 查看幫助rest

➜  rar ./unrar 

UNRAR 5.60 freeware      Copyright (c) 1993-2018 Alexander Roshal

Usage:     unrar - -  
               < @listfiles...> 


  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


  -             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      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       Additionally filter included files
  n@            Read additional filter masks from stdin
  n@      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[obj]  Specify the character set
  sl      Process files with size less than specified
  sm      Process files with size more than specified
  ta      Process files modified after  in YYYYMMDDHHMMSS format
  tb      Process files modified before  in YYYYMMDDHHMMSS format
  tn      Process files newer than 
  to      Process files older than 
  ts[m|c|a]     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       Exclude specified file
  x@            Read file names to exclude from stdin
  x@      Exclude files listed in specified list file
  y             Assume Yes on all queries

其餘解壓縮命令:orm

一、*.tar 用 tar –xvf 解壓 
二、*.gz 用 gzip -d或者gunzip 解壓 
三、*.tar.gz和*.tgz 用 tar –xzf 解壓 
四、*.bz2 用 bzip2 -d或者用bunzip2 解壓 
五、*.tar.bz2用tar –xjf 解壓 
六、*.Z 用 uncompress 解壓 
七、*.tar.Z 用tar –xZf 解壓 
八、*.rar 用 unrar e解壓 
九、*.zip 用 unzip 解壓

原文來自:https://www.linuxprobe.com/linux-rar-decompression.htmlhtm

相關文章
相關標籤/搜索