windows平台很多壓縮文檔為rar檔案,那麼怎麼做到Linux解壓rar檔案(unrar安裝和使用)?
簡單,centos5安裝unrar即可。 unrar安裝方法如下:
wget http://dag.wieers.com/rpm/packages/unrar/unrar-3.6.8-1.el5.rf.i386.rpm;rpm -Uvh unrar-3.6.8-1.el5.rf.i386.rpm;
複製上面的命令,在root下執行即可。
基本unrar用法: unrar x -o- -y CTOHome.com.rar /home/www.CTOHome.com/ (把CTOHome.com.rar檔案,解壓到/home/www.CTOHome.com目錄。要注意解壓目錄必須以 / 結束)
unrar分卷解壓: 假設第一個分卷的檔案名稱CTOHome.r00,所有分卷都在同一個目錄。
那麼就直接 unrar x -o- -y CTOHome.r00 /home/www.CTOHome.com/
其他動作系統的unrar下載: http://dag.wieers.com/rpm/packages/unrar/
unrar使用協助
用法: unrar <命令> -<開關 1> -<開關 N> <壓縮檔> <檔案...>
<@列表檔案...> <解壓路徑\>
<注釋>
e 解壓壓縮檔到目前的目錄
l[t,b] 列出壓縮檔[技術資訊,簡潔]
p 列印檔案到標準輸出裝置
t 測試壓縮檔
v[t,b] 詳細列出壓縮檔[技術資訊,簡潔]
x 用絕對路徑解壓檔案
<開關>
- 停止掃描
ac 壓縮或解壓後清除存檔屬性
ad 添加壓縮檔名到目標路徑
ap<路徑> 添加路徑到壓縮檔中
av- 禁用使用者身份校正
c- 禁用注釋顯示
cfg- 禁用讀取配置
cl 名稱轉換為小寫
cu 名稱轉換為大寫
dh 開啟共用檔案
ep 從名稱中排除路徑
ep3 擴充路徑為包含盤符的完全路徑
f 重新整理檔案
id[c,d,p,q] 禁止資訊顯示
ierr 發送所有訊息到標準錯誤裝置
inul 禁用所有訊息
ioff 完成一個操作後關閉 PC 電源
kb 保留損壞的已解壓檔案
n<檔案> 僅包括指定檔案
n@ 從標準輸入裝置讀取要包含的檔案名稱
n@<列表> 在指定列表檔案包括檔案
o+ 覆蓋已存在檔案
o- 不覆蓋已存在檔案
oc 設定 NTFS 壓縮屬性
or 自動重新命名檔案
ow 儲存或恢複檔案所有權和組
[密碼] 設定密碼
p- 不詢問密碼
r 包含子目錄
ri<P>[:<S>] 設定優先權 (0-預設,1-最小..15-最大) 和休眠時間(毫秒)
sl<大小> 處理小於指定大小的檔案
sm<大小> 處理大於指定大小的檔案
ta<日期> 添加日期 <日期> 後修改的檔案,日期格式 YYYYMMDDHHMMSS
tb<日期> 添加日期 <日期> 前修改的檔案,日期格式 YYYYMMDDHHMMSS
tn<時間> 添加 <時間> 以後的檔案
to<時間> 添加 <時間> 以前的檔案
ts<m,c,a>[N] 儲存或恢複檔案時間(修改,建立,訪問)
u 更新檔案
v 列出所有卷
ver[n] 檔案版本控制
vp 每卷之前暫停
x<檔案> 排除指定的檔案
x@ 從標準輸入裝置讀取要排除的檔案名
x@<列表> 排除指定列表檔案中的檔案
y 假設對全部詢問都回答是
UNRAR 3.60 freeware Copyright (c) 1993-2006 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
or Rename files automatically
ow Save or restore file owner and group
p[password] Set password
p- Do not query password
r Recurse subdirectories
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>