小知识:Linux 下解压 rar 文件的方法

网上下载rar 压缩文件的使用,在linux在我们需要对其进行解压缩,这个时候,我们需要安装 rar相关的文件,来进行解压缩。

1. 下载

我们进入rarlab网站,进行下载 rar for linux x64

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

?
1
Downloads tar -xvf rarlinux-x64-5.6.0.tar.gz

3. 进入文件夹make (需要 管理员权限)

?
1
2
3
4
5
6
7
8
9
10
11
12
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 需要在命令所在的文件夹执行命令,或者把文件夹加入环境变量中。

3. 最后,可以使用 unrar 进行解压, 使用 rar 命令,进行压缩

 ~ unrar x [file]

我们 可以直接输入 unrar 查看帮助

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
rar ./unrar
UNRAR 5.60 freeware   Copyright (c) 1993-2018 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
n@      Read additional filter masks from stdin
n@<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]   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 listed in specified list file
y       Assume Yes on all queries

其他解压缩命令:

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 解压

总结

以上所述是小编给大家介绍的Linux 下解压 rar 文件的方法,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对服务器之家网站的支持!

原文链接:https://www.cnblogs.com/xuyaowen/archive/2018/07/02/unrar_files.html

声明: 猿站网有关资源均来自网络搜集与网友提供,任何涉及商业盈利目的的均不得使用,否则产生的一切后果将由您自己承担! 本平台资源仅供个人学习交流、测试使用 所有内容请在下载后24小时内删除,制止非法恶意传播,不对任何下载或转载者造成的危害负任何法律责任!也请大家支持、购置正版! 。本站一律禁止以任何方式发布或转载任何违法的相关信息访客发现请向站长举报,会员发帖仅代表会员个人观点,并不代表本站赞同其观点和对其真实性负责。本网站的资源部分来源于网络,如有侵权烦请发送邮件至:2697268773@qq.com进行处理。
建站知识

小知识:Linux学习教程之redis哨兵集群详解

2023-3-24 7:18:28

建站知识

小知识:linux contos6.8下部署kafka集群的方法

2023-3-24 7:35:16

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索