ubuntu 下解压带密码的rar压缩包

新建**.sh,copy下面这段脚本,就可以解压指定文件夹下的全部rar加密文件

#!/bin/sh  
#unrar files  
#source .rar file path  
docSrc="/../../1"   
#save unrar file path  
unfileSrc="/../../1"  

#解压密码
mm='****' #your password
#log file recodes error  
errorPath="..."  
if [ ! -f $errorPath ]  
   then  
        touch $errorPath  
        chmod 755 $errorPath  
   break  
fi  
if [ ! -d "$unfileSrc" ]  
   then  
        mkdir $unfileSrc  
   break  
fi  
#start unrar files  
for file in `find $docSrc -name "*.rar"`  
do  
   unrar x -o- -p$mm -r -y $file $unfileSrc 2>>$errorPath  
   echo -e "\n">>$errorPath  
done

 

--------------------------------------------------------------分割线--------------------------------------------------------------------

一个文件夹压缩为多个压缩文件及解压

你需要压缩x这个文件,每个分卷100M,就输入

tar -cjv x | split -b 100m

会生成100m的几个文件,名为xaa,xab,xac……
解包就用

cat x* > bbb

这个bbb可以是你指定的任意文件名,然后

tar -xvf bbb

你可能感兴趣的:(Linux)