网上下载rar 压缩文件的使用,在linux在我们需要对其进行解压缩,这个时候,我们需要安装 rar相关的文件,来进行解压缩。
1. 下载
我们进入rarlab网站,进行下载 rar for linux x64
2. 使用 tar 命令 解压 (*.tar 用 tar –xvf )
➜ Downloads tar -xvf rarlinux-x64-5.6.0.tar.gz
3. 进入文件夹make (需要 管理员权限)
1➜ rar cat makefile 2################################################################### 3# Installing RAR executables, configuration files and SFX modules # 4# to appropriate directories # 5################################################################### 6 7PREFIX=/usr/local 8 9install: 10 mkdir -p $(PREFIX)/bin 11 mkdir -p $(PREFIX)/lib 12 cp rar unrar $(PREFIX)/bin 13 cp rarfiles.lst /etc 14 cp default.sfx $(PREFIX)/lib%
如果不进行make 需要在命令所在的文件夹执行命令,或者把文件夹加入环境变量中。
3. 最后,可以使用 unrar 进行解压, 使用 rar 命令,进行压缩。
➜ ~ unrar x [file]
我们 可以直接输入 unrar 查看帮助

1➜ rar ./unrar 2 3UNRAR 5.60 freeware Copyright (c) 1993-2018 Alexander Roshal 4 5Usage: unrar <command> -<switch 1> -<switch N> <archive> <files...> 6 <@listfiles...> <path_to_extract\> 7 8<Commands> 9 e Extract files without archived paths 10 l[t[a],b] List archive contents [technical[all], bare] 11 p Print file to stdout 12 t Test archive files 13 v[t[a],b] Verbosely list archive contents [technical[all],bare] 14 x Extract files with full path 15 16<Switches> 17 - Stop switches scanning 18 @[+] Disable [enable] file lists 19 ad Append archive name to destination path 20 ag[format] Generate archive name using the current date 21 ai Ignore file attributes 22 ap<path> Set path inside archive 23 c- Disable comments show 24 cfg- Disable read configuration 25 cl Convert names to lower case 26 cu Convert names to upper case 27 dh Open shared files 28 ep Exclude paths from names 29 ep3 Expand paths to full including the drive letter 30 f Freshen files 31 id[c,d,p,q] Disable messages 32 ierr Send all messages to stderr 33 inul Disable all messages 34 kb Keep broken extracted files 35 n<file> Additionally filter included files 36 n@ Read additional filter masks from stdin 37 n@<list> Read additional filter masks from list file 38 o[+|-] Set the overwrite mode 39 ol[a] Process symbolic links as the link [absolute paths] 40 or Rename files automatically 41 ow Save or restore file owner and group 42 p[password] Set password 43 p- Do not query password 44 r Recurse subdirectories 45 sc<chr>[obj] Specify the character set 46 sl<size> Process files with size less than specified 47 sm<size> Process files with size more than specified 48 ta<date> Process files modified after <date> in YYYYMMDDHHMMSS format 49 tb<date> Process files modified before <date> in YYYYMMDDHHMMSS format 50 tn<time> Process files newer than <time> 51 to<time> Process files older than <time> 52 ts[m|c|a] Save or restore file time (modification, creation, access) 53 u Update files 54 v List all volumes 55 ver[n] File version control 56 vp Pause before each volume 57 x<file> Exclude specified file 58 x@ Read file names to exclude from stdin 59 x@<list> Exclude files listed in specified list file 60 y Assume Yes on all queries
View Code
其他解压缩命令:
1、*.tar 用 tar –xvf 解压
2、*.gz 用 gzip -d或者gunzip 解压
3、*.tar.gz和*.tgz 用 tar –xzf 解压
4、*.bz2 用 bzip2 -d或者用bunzip2 解压
5、*.tar.bz2用tar –xjf 解压
6、*.Z 用 uncompress 解压
7、*.tar.Z 用tar –xZf 解压
8、*.rar 用 unrar e解压
9、*.zip 用 unzip 解压