RAR命令
虽说RAR是商业软件, 但是并不妨碍我们使用它啊.
Linux下也有rar
命令呢!
建立一个rar压缩包
语法:
rar a {.rar file-name} {file-name}
很简单:
➤ rar a sh.rar *.sh
RAR 5.30 beta 2 Copyright (c) 1993-2015 Alexander Roshal 4 Aug 2015
Trial version Type RAR -? for help
Evaluation copy. Please register.
Creating archive sh.rar
Adding 4.sh OK
Adding cal_random.sh OK
Adding cmd.sh OK
Adding ifs.sh OK
Adding redirect.sh OK
Adding std.sh OK
Done
➤
支持正则, 支持递归.
解压rar压缩包
解压也很简单:
➤ unrar e sh.rar
UNRAR 5.30 beta 2 freeware Copyright (c) 1993-2015 Alexander Roshal
Extracting from sh.rar
Extracting 4.sh OK
Extracting cal_random.sh OK
Extracting cmd.sh OK
Extracting ifs.sh OK
Extracting redirect.sh OK
Extracting std.sh OK
All OK
➤
列出压缩包内的内容
➤ unrar l sh.rar
UNRAR 5.30 beta 2 freeware Copyright (c) 1993-2015 Alexander Roshal
Archive: sh.rar
Details: RAR 4
Attributes Size Date Time Name
----------- --------- ---------- ----- ----
-rw-rw-r-- 25 2016-01-18 16:10 4.sh
-rw-rw-r-- 542 2015-12-24 14:08 cal_random.sh
-rw-rw-r-- 41 2016-01-18 11:02 cmd.sh
-rw-rw-r-- 27 2016-01-17 19:19 ifs.sh
-rw-rw-r-- 50 2016-01-18 13:24 redirect.sh
-rw-rw-r-- 56 2016-01-18 11:08 std.sh
----------- --------- ---------- ----- ----
741 6
➤
压缩加密
➤ rar a -p"Hello" sh.rar *.sh
RAR 5.30 beta 2 Copyright (c) 1993-2015 Alexander Roshal 4 Aug 2015
Trial version Type RAR -? for help
Evaluation copy. Please register.
Creating archive sh.rar
Adding 4.sh OK
Adding cal_random.sh OK
Adding cmd.sh OK
Adding ifs.sh OK
Adding redirect.sh OK
Adding std.sh OK
Done
➤