Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of rar under linux

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how to use rar under linux, the quality of the article content is high, so Xiaobian shares it with you as a reference, I hope you have a certain understanding of related knowledge after reading this article.

The rar tool is easy to use under windows and also easy to use under linux.

First download a rarlinux-4.1.0.tar.gz package, then unzip it and install it.

[root@test02 user]# tar -zxvf rarlinux-4.1.0.tar.gz

rar/

rar/rar.txt

rar/license.txt

rar/readme.txt

rar/technote.txt

rar/order.htm

rar/whatsnew.txt

rar/rar

rar/unrar

rar/rar_static

rar/makefile

rar/default.sfx

rar/rarfiles.lst

[root@test02 user]# ll

Total 63,272

drwxrwxr-x 7 501 501 4096 01-12 18:32 nrpe-2.12

-rw-r--r-- 1 root root 405725 2009-11-23 nrpe-2.12.tar.gz

drwxr-xr-x 2 1000 1000 4096 01-09 21:53 rar

-rw-rw-r-- 1 user user 915027 02-06 14:50 rarlinux-4.1.0.tar.gz

[root@test02 user]# cd rar

[root@test02 rar]# ll

Total 1904

-rwxr-xr-x 1 1000 1000 137064 01-09 21:53 default.sfx

-rw-r--r-- 1 1000 1000 7477 01-09 21:53 license.txt

-rw-r--r-- 1 1000 1000 428 01-09 21:53 makefile

-rw-r--r-- 1 1000 1000 3178 01-09 21:53 order.htm

-rwxr-xr-x 1 1000 1000 391140 01-09 21:53 rar

-rw-r--r-- 1 1000 1000 1147 01-09 21:53 rarfiles.lst

-rwxr-xr-x 1 1000 1000 1027528 01-09 21:53 rar_static

-rw-r--r-- 1 1000 1000 82384 01-09 21:53 rar.txt

-rw-r--r-- 1 1000 1000 782 01-09 21:53 readme.txt

-rw-r--r-- 1 1000 1000 8959 01-09 21:53 technote.txt

-rwxr-xr-x 1 1000 1000 232368 01-09 21:53 unrar

-rw-r--r-- 1 1000 1000 12236 01-09 21:53 whatsnew.txt

[root@test02 rar]# make & make install

mkdir -p /usr/local/bin

mkdir -p /usr/local/lib

cp rar unrar /usr/local/bin

cp rarfiles.lst /etc

cp default.sfx /usr/local/lib

[root@test02 rar]# cd ..

[root@test02 user]# ll

Total 63,272

drwxrwxr-x 7 501 501 4096 01-12 18:32 nrpe-2.12

-rw-r--r-- 1 root root 405725 2009-11-23 nrpe-2.12.tar.gz

drwxr-xr-x 2 1000 1000 4096 01-09 21:53 rar

-rw-rw-r-- 1 user user 915027 02-06 14:50 rarlinux-4.1.0.tar.gz

and see if you can compress it.

[root@test02 user]# rar a nrpe-2.12.rar /nrpe-2.12

rar: /lib/libc.so.6: version `GLIBC_2.7' not found (required by rar)

Tip: There is a file that cannot be compressed. In fact, it is a version mismatch problem.

[root@test02 user]# ls

nrpe-2.12.tar.gz rarlinux-4.1.0.tar.gz rar nrpe-2.12

[root@test02 user]# cd rar

[root@test02 rar]# cp rar_static /usr/local/bin/rar

cp: Overwrite "/usr/local/bin/rar"? yes

(static linking version, so there is no problem with glibc library version mismatch)

[root@test02 rar]# ll

Total 1904

-rwxr-xr-x 1 1000 1000 137064 01-09 21:53 default.sfx

-rw-r--r-- 1 1000 1000 7477 01-09 21:53 license.txt

-rw-r--r-- 1 1000 1000 428 01-09 21:53 makefile

-rw-r--r-- 1 1000 1000 3178 01-09 21:53 order.htm

-rwxr-xr-x 1 1000 1000 391140 01-09 21:53 rar

-rw-r--r-- 1 1000 1000 1147 01-09 21:53 rarfiles.lst

-rwxr-xr-x 1 1000 1000 1027528 01-09 21:53 rar_static

-rw-r--r-- 1 1000 1000 82384 01-09 21:53 rar.txt

-rw-r--r-- 1 1000 1000 782 01-09 21:53 readme.txt

-rw-r--r-- 1 1000 1000 8959 01-09 21:53 technote.txt

-rwxr-xr-x 1 1000 1000 232368 01-09 21:53 unrar

-rw-r--r-- 1 1000 1000 12236 01-09 21:53 whatsnew.txt

[root@test02 rar]# rar m 11.rar readme.txt (the m parameter deletes the original document after compression)

RAR 4.10 Copyright (c) 1993-2012 Alexander Roshal 9 Jan 2012

Shareware version Type RAR -? for help

Evaluation copy. Please register.

Creating archive 11.rar

Adding readme.txt OK

Deleting readme.txt deleted

Done

[root@test02 rar]# ll

Total 1904

-rw-r--r-- 1 root root 492 02-06 16:04 11.rar

-rwxr-xr-x 1 1000 1000 137064 01-09 21:53 default.sfx

-rw-r--r-- 1 1000 1000 7477 01-09 21:53 license.txt

-rw-r--r-- 1 1000 1000 428 01-09 21:53 makefile

-rw-r--r-- 1 1000 1000 3178 01-09 21:53 order.htm

-rwxr-xr-x 1 1000 1000 391140 01-09 21:53 rar

-rw-r--r-- 1 1000 1000 1147 01-09 21:53 rarfiles.lst

-rwxr-xr-x 1 1000 1000 1027528 01-09 21:53 rar_static

-rw-r--r-- 1 1000 1000 82384 01-09 21:53 rar.txt

-rw-r--r-- 1 1000 1000 8959 01-09 21:53 technote.txt

-rwxr-xr-x 1 1000 1000 232368 01-09 21:53 unrar

-rw-r--r-- 1 1000 1000 12236 01-09 21:53 whatsnew.txt

[root@test02 rar]# rar a 11.rar readme.txt (parameter a does not change the original document, generate compressed package)

Decompression using the e parameter

[root@test02 rar]#rar e 11.rar Decompress (or unrar e 11.rar)

Review and summary:

compression

tar -cvf jpg.tar *.jpg //Package all jpg files in the directory as tar.jpg

tar -czf jpg.tar.gz *.jpg //Package all jpg files in the directory as jpg.tar.gz

tar -cjf jpg.tar.bz2 *.jpg //Package all jpg files in the directory as jpg.tar.bz2

tar -cZf jpg.tar.Z *.jpg //Package all jpg files in the directory as jpg.tar.Z

rar a jpg.rar *.jpg //rar compression format

zip jpg.zip *.jpg //zip format compression

decompression

tar -xvf file. tar//extract tarpack

tar -xzvf file. tar. gz//extract tar.gz

tar -xjvf file.tar.bz2 //extract tar.bz2

tar -xZvf file.tar.Z //extract tar.Z

unrar e file. rar//unzip rar

unzip www.example.com//unzip file.zip

summary

1. *.tar decompresses with tar -xvf

2. *.gz unzip with gzip -d or gunzip

3. *.tar.gz and *.tgz are decompressed with tar -xzvf

4. *.bz2 unzip with bzip2 -d or bunzip2

5. *.tar.bz2 Decompress with tar -xjvf

6. *.Z decompresses with uncompress

7. *.tar.Z Decompress with tar -xZvf

8. *.rar Decompress with unrar e

9. *.zip Unzip

How to use rar under linux is shared here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report