繁体   English   中英

在 linux 中使用 tar 将您的主目录的内容归档

[英]Use tar to archive the contents of your home directory in linux

我正在尝试使用 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.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM