阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Linux之rar文件解压之路

58次阅读
没有评论

共计 2506 个字符,预计需要花费 7 分钟才能阅读完成。

导读 相信大家在使用 Linux 系统时有时候会碰到有关于 rar 文件的解压缩。网上下载 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 (需要 管理员权限)
➜ 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 需要在命令所在的文件夹执行命令,或者把文件夹加入环境变量中。

4. 最后,可以使用 unrar 进行解压,使用 rar 命令,进行压缩。
➜  ~ unrar x [file]

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

➜ 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  此处含有隐藏内容,需要正确输入密码后可见! 立即查看 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

其他解压缩命令:

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

阿里云 2 核 2G 服务器 3M 带宽 61 元 1 年,有高配

腾讯云新客低至 82 元 / 年,老客户 99 元 / 年

代金券:在阿里云专用满减优惠券

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2024-11-16发表,共计2506字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中