700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > Linux解压rar压缩文件 rar unrar

Linux解压rar压缩文件 rar unrar

时间:2023-01-03 17:01:34

相关推荐

Linux解压rar压缩文件 rar unrar

Linux系统不支持rar压缩文件解压,所以要先安装在进行解压。

需要先装make哦,如果没安装需要安装一下呦

1,首先要在tools文件夹下面进行安装,没有就mkdir好了

[root@izuf6bgrqpp01oqg9andmhz ~]# cd /usr/local/[root@izuf6bgrqpp01oqg9andmhz local]# lltotal 52drwxr-xr-x 8 root root 4096 Nov 6 05:17 aegisdrwxr-xr-x. 2 root root 4096 Nov 5 bindrwxr-xr-x 10 root root 4096 Nov 5 16:19 cloudmonitordrwxr-xr-x. 2 root root 4096 Nov 5 etcdrwxr-xr-x. 2 root root 4096 Nov 5 gamesdrwxr-xr-x. 2 root root 4096 Nov 5 includedrwxr-xr-x. 2 root root 4096 Nov 5 libdrwxr-xr-x. 2 root root 4096 Nov 5 lib64drwxr-xr-x. 2 root root 4096 Nov 5 libexecdrwxr-xr-x 10 root root 4096 Nov 6 10:04 openrestydrwxr-xr-x. 2 root root 4096 Nov 5 sbindrwxr-xr-x. 6 root root 4096 Nov 5 16:17 sharedrwxr-xr-x. 2 root root 4096 Nov 5 16:21 src[root@izuf6bgrqpp01oqg9andmhz local]# mkdir tools[root@izuf6bgrqpp01oqg9andmhz local]# cd tools/

2,然后去下载文件喽

[root@izuf6bgrqpp01oqg9andmhz tools]# wget /rar/rarlinux-x64-5.6.0.tar.gz

完蛋了我的出错了

[root@izuf6bgrqpp01oqg9andmhz tools]# wget /rar/rarlinux-x64-5.6.0.tar.gz---11-12 14:35:48-- /rar/rarlinux-x64-5.6.0.tar.gzResolving ()... 51.195.68.162Connecting to ()|51.195.68.162|:443... connected.ERROR: cannot verify 's certificate, issued by ‘/C=US/O=Let's Encrypt/CN=R3’:Issued certificate has expired.To connect to insecurely, use `--no-check-certificate'.

问题不大 自己下载一个 使用ftp传上去 下载地址 链接

3,然后运行命令 解压 tra.gz文件

[root@izuf6bgrqpp01oqg9andmhz tools]# tar -xvf linuxrar-5.6.tar.gz

4,进入rar文件夹 开始make(也就是复制文件)

[root@izuf6bgrqpp01oqg9andmhz tools]# cd rar [root@izuf6bgrqpp01oqg9andmhz rar]# make'mkdir -p /usr/local/binmkdir -p /usr/local/libcp rar unrar /usr/local/bincp rarfiles.lst /etccp default.sfx /usr/local/lib[root@izuf6bgrqpp01oqg9andmhz rar]# make installmkdir -p /usr/local/binmkdir -p /usr/local/libcp rar unrar /usr/local/bincp rarfiles.lst /etccp default.sfx /usr/local/lib

5,进入你需要解压文件的文件夹,开始解压文件

[root@izuf6bgrqpp01oqg9andmhz rar]# cd /xxx/xxx/x/xxx/xxxx[root@izuf6bgrqpp01oqg9andmhz myhunli]# rar x fff.rar

上面这是解压到当前文件夹

[root@izuf6bgrqpp01oqg9andmhz myhunli]# rar x sss.rar /usr/xxx/xxx/xxx/xxx/aaa

上面这是解压到指定文件夹

6,其他的解压方式

如果不使用x还有e x是带有文件夹结构的 e是所有文件直接解压到根目录

sss.rar 里面结构是 sss.rar/sss/aaa.txt sss.rar/sss/xxx/xxx.txt 请欣赏结果

[root@izuf6bgrqpp01oqg9andmhz myhunli]# rar e sss.rar RAR 5.60 Copyright (c) 1993- Alexander Roshal 24 Jun Trial version Type 'rar -?' for helpExtracting from sss.rarExtracting aaa.txt OK Extracting xxx.txt OK All OK[root@izuf6bgrqpp01oqg9andmhz myhunli]# lltotal 3042688-rw-r--r-- 1 root root0 Nov 12 15:33 aaa.txt-rw-r--r-- 1 root root 3115692736 Nov 12 13:46 fff.rardrwxr-xr-x 6 root root 4096 Nov 12 14:47 MyHunli-rw-r--r-- 1 root root 196 Nov 12 15:44 sss.rar-rw-r--r-- 1 root root0 Nov 12 15:44 xxx.txt[root@izuf6bgrqpp01oqg9andmhz myhunli]#

[root@izuf6bgrqpp01oqg9andmhz myhunli]# rar e sss.rar /xxx/xxx/xxx/xxx/aaaRAR 5.60 Copyright (c) 1993- Alexander Roshal 24 Jun Trial version Type 'rar -?' for helpExtracting from sss.rarExtracting /xxx/xxx/xxx/xxx/aaa/aaa.txt OK Extracting /xxx/xxx/xxx/xxx/aaa/xxx.txt OK All OK[root@izuf6bgrqpp01oqg9andmhz myhunli]# lltotal 3042688drwxr-xr-x 2 root root 4096 Nov 12 15:47 aaa-rw-r--r-- 1 root root 3115692736 Nov 12 13:46 fff.rardrwxr-xr-x 6 root root 4096 Nov 12 14:47 MyHunli-rw-r--r-- 1 root root 196 Nov 12 15:44 sss.rar[root@izuf6bgrqpp01oqg9andmhz myhunli]# cd aaa/[root@izuf6bgrqpp01oqg9andmhz aaa]# lltotal 0-rw-r--r-- 1 root root 0 Nov 12 15:33 aaa.txt-rw-r--r-- 1 root root 0 Nov 12 15:44 xxx.txt

7,剩余其他的解压方式 键入rar或者unrar就可以查看

[root@izuf6bgrqpp01oqg9andmhz aaa]# rarRAR 5.60 Copyright (c) 1993- Alexander Roshal 24 Jun Trial version Type 'rar -?' for helpUsage:rar <command> -<switch 1> -<switch N> <archive> <files...><@listfiles...> <path_to_extract\><Commands>a Add files to archivec Add archive commentch Change archive parameterscw Write archive comment to filed Delete files from archivee Extract files without archived pathsf Freshen files in archivei[par]=<str> Find string in archivesk Lock archivel[t[a],b]List archive contents [technical[all], bare]m[f]Move to archive [files only]p Print file to stdoutr Repair archiverc Reconstruct missing volumesrn Rename archived filesrr[N] Add data recovery recordrv[N] Create recovery volumess[name|-]Convert archive to or from SFXt Test archive filesu Update files in archivev[t[a],b]Verbosely list archive contents [technical[all],bare]x Extract files with full path<Switches>- Stop switches scanning@[+]Disable [enable] file listsad Append archive name to destination pathag[format] Generate archive name using the current dateai Ignore file attributesap<path>Set path inside archiveas Synchronize archive contentsc- Disable comments showcfg-Disable read configurationcl Convert names to lower casecu Convert names to upper casedf Delete files after archivingdh Open shared filesds Disable name sort for solid archivedw Wipe files after archivinge[+]<attr> Set file exclude and include attributesed Do not add empty directoriesen Do not put 'end of archive' blockep Exclude paths from namesep1 Exclude base directory from namesep3 Expand paths to full including the drive letterf Freshen fileshp[password] Encrypt both file data and headersht[b|c] Select hash type [BLAKE2,CRC32] for file checksumid[c,d,p,q] Disable messagesierrSend all messages to stderrilog[name] Log errors to fileinulDisable all messagesisndEnable soundiverDisplay the version numberk Lock archivekb Keep broken extracted fileslog[f][=name] Write names to log filem<0..5> Set compression level (0-store...3-default...5-maximal)ma[4|5] Specify a version of archiving formatmc<par> Set advanced compression parametersmd<n>[k,m,g] Dictionary size in KB, MB or GBms[ext;ext] Specify file types to storemt<threads> Set the number of threadsn<file> Additionally filter included filesn@ Read additional filter masks from stdinn@<list>Read additional filter masks from list fileo[+|-] Set the overwrite modeoh Save hard links as the link instead of the fileoi[0-4][:min] Save identical files as referencesol[a] Process symbolic links as the link [absolute paths]or Rename files automaticallyow Save or restore file owner and groupp[password] Set passwordp- Do not query passwordqo[-|+] Add quick open information [none|force]r Recurse subdirectoriesr- Disable recursionr0 Recurse subdirectories for wildcard names onlyrr[N] Add data recovery recordrv[N] Create recovery volumess[<N>,v[-],e] Create solid archives- Disable solid archivingsc<chr>[obj] Specify the character setsfx[name]Create SFX archivesi[name]Read data from standard input (stdin)sl<size>Process files with size less than specifiedsm<size>Process files with size more than specifiedt Test files after archivingta<date>Process files modified after <date> in YYYYMMDDHHMMSS formattb<date>Process files modified before <date> in YYYYMMDDHHMMSS formattk Keep original archive timetl Set archive time to latest filetn<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 filesv<size>[k,b] Create volumes with size=<size>*1000 [*1024, *1]ver[n] File version controlvn Use the old style volume naming schemevp Pause before each volumew<path> Assign work directoryx<file> Exclude specified filex@ Read file names to exclude from stdinx@<list>Exclude files listed in specified list filey Assume Yes on all queriesz[file] Read archive comment from file[root@izuf6bgrqpp01oqg9andmhz aaa]# unrarUNRAR 5.60 freewareCopyright (c) 1993- Alexander RoshalUsage:unrar <command> -<switch 1> -<switch N> <archive> <files...><@listfiles...> <path_to_extract\><Commands>e Extract files without archived pathsl[t[a],b]List archive contents [technical[all], bare]p Print file to stdoutt Test archive filesv[t[a],b]Verbosely list archive contents [technical[all],bare]x Extract files with full path<Switches>- Stop switches scanning@[+]Disable [enable] file listsad Append archive name to destination pathag[format] Generate archive name using the current dateai Ignore file attributesap<path>Set path inside archivec- Disable comments showcfg-Disable read configurationcl Convert names to lower casecu Convert names to upper casedh Open shared filesep Exclude paths from namesep3 Expand paths to full including the drive letterf Freshen filesid[c,d,p,q] Disable messagesierrSend all messages to stderrinulDisable all messageskb Keep broken extracted filesn<file> Additionally filter included filesn@ Read additional filter masks from stdinn@<list>Read additional filter masks from list fileo[+|-] Set the overwrite modeol[a] Process symbolic links as the link [absolute paths]or Rename files automaticallyow Save or restore file owner and groupp[password] Set passwordp- Do not query passwordr Recurse subdirectoriessc<chr>[obj] Specify the character setsl<size>Process files with size less than specifiedsm<size>Process files with size more than specifiedta<date>Process files modified after <date> in YYYYMMDDHHMMSS formattb<date>Process files modified before <date> in YYYYMMDDHHMMSS formattn<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 filesv List all volumesver[n] File version controlvp Pause before each volumex<file> Exclude specified filex@ Read file names to exclude from stdinx@<list>Exclude files listed in specified list filey Assume Yes on all queries

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。