rar是一个商业软件,但有时候我们需要在linux 下做批量操作,这时候就需要用到命令,下面我们来说说rar、unrar在命令行下的一些操作,希望对你们有所帮助!
一、安装winrar
winrar从v5开始,只提供window和linux版的,而linux版只提供二进制文件,这样我们就可以直接在命令行进行操作。比如在terminal下压缩文件a.xls到文件 a.xls.rar中,语法如下:
rar a ‘a.xls.rar’ ‘a.xls’ #
使用起来非常简单,类似linux下的tar
参考:
其他常用的rar语法:
|
|
二、配置
2.1 key配置
WinRAR, RAR for Unix and OS X now use the same registration key format, so you can use the same key with current WinRAR and RAR versions for all mentioned platforms.
so Yes, it is possible.
Further, it also states where to copy the key:
If you use RAR/Unix and RAR for OS X, you should copy rarreg.key to your home directory or to one of the following directories: /etc, /usr/lib, /usr/local/lib, /usr/local/etc. You may rename it to .rarreg.key or .rarregkey, if you wish, but rarreg.key is also valid.
参考:https://superuser.com/questions/1089501/how-to-transfer-winrar-key-to-linux
分享我的rarreg.key
:
|
|
然后复制或添加软链接到配置目录,你可能要执行这样的命令: