我的场景中有 2 个 rar 文件,它们的名称分别是1.rar
和2.rar
。我的目的:1.rar
提取到folder1
并2.rar
提取到folder2
.
首先,我将1.rar
文件提取到folder1
带有unar
( unar -o folder1 x/1.rar
) 的文件夹。
一切都很好,但如果我将2.rar
文件解压到folder2
( unar -o folder2 x/2.rar
),然后将 1.rar 的数据解压到文件夹 2 中。
为什么它要处理以前的 rar 文件?
操作系统:Centos 7。
场景代码:
[root@vm-app home]# unar -o folder1 x/1.rar
x/1.rar: RAR 5
1/1 - Copy.txt (0 B)... OK.
1/1.txt (0 B)... OK.
1/ (dir)... OK.
Successfully extracted to "folder1/1".
[root@vm-app home]# unar -o folder2 x/2.rar
x/2.rar: RAR 5
1/1 - Copy.txt (0 B)... OK.
1/1.txt (0 B)... OK.
1/ (dir)... OK.
Successfully extracted to "folder2/1".
[root@vm-app home]# ls folder1
1
[root@vm-app home]# ls folder2
1
[root@vm-app home]# rm -rf folder1 && rm -rf folder2
[root@vm-app home]# unar -o folder2 x/2.rar
x/2.rar: RAR 5
1/1 - Copy.txt (0 B)... OK.
1/1.txt (0 B)... OK.
1/ (dir)... OK.
Successfully extracted to "folder2/1".
[root@vm-app home]# rm -rf folder2
[root@vm-app home]# rm x/1.rar
rm: remove regular file ‘x/1.rar’? y
[root@vm-app home]# unar -o folder2 x/2.rar
x/2.rar: RAR 5
2/2 - Copy.txt (0 B)... OK.
2/2.txt (0 B)... OK.
2/ (dir)... OK.
Successfully extracted to "folder2/2".
[root@vm-app home]# ls folder2
2
[root@vm-app home]#