如何在 Linux 中创建多部分 tar 文件?

hop*_*ekr 22 linux command-line tar

如何在 Linux 中创建多部分 tar 文件?

Ian*_* C. 31

您可以使用该split命令将存档拆分为多个文件。例如,如果我希望我的档案存储在 1 MB 的文件中:

tar -cvf - <stuff to put in archive> | split --bytes=1m --suffix-length=4 --numeric-suffix - myarchive.tar.
Run Code Online (Sandbox Code Playgroud)

当我想重新组合和解压缩时:

cat myarchive.tar.* | tar xvf -
Run Code Online (Sandbox Code Playgroud)