Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在一个目录中有大约 100 个 rar 文件,我想在 Ubuntu 20.04 的终端中使用 unrar 将它们提取到同一目录中。我用下面的命令一一解压就OK了:
unrar e -pMy_Password RandomFileName.rar
如何同时提取所有文件?
文件名没有特定的模式,但所有的都是 rar 文件。
尝试这个
unrar -P PASSWORD '*.rar'
我使用以下命令成功(没有创建 bash 文件):
for f in *.rar; do unrar e -pMyPassword $f done;
之后,它需要输入,我输入完成,它开始成功提取文件。不幸的是,我不知道为什么它需要另一个“完成”,但是,它运作良好。
在命令中,“e”参数代表“提取”,您必须在 -p 开关后立即输入密码。