我正在尝试使用 tar 归档我的主目录的内容,然后使用 gzip 压缩 tar 文件。我知道您可以使用 cat、tar 和 gzip 解压缩和解档 .tar.gz 文件。但是,我不知道如何压缩和存档。
最佳答案
嘿,这里有您的问题的链接。完整指南
https://www.howtogeek.com/248780/how-to-compress-and-extract-files-using-the-tar-command-on-linux/
tar -czvf name-of-archive.tar.gz /path/to/directory-or-file
这些开关的实际含义如下:
-c: Create an archive.
-z: Compress the archive with gzip.
-v: Display progress in the terminal while creating the archive, also known as “verbose” mode. The v is always optional in these commands, but it’s helpful.
-f: Allows you to specify the filename of the archive.
关于linux - 使用 tar 将 Linux 主目录的内容归档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49153719/