Tar commands explained in detail

tar is a command-line tool for creating, viewing, extracting, and compressing archives on Unix and Unix-like systems. It is commonly used to combine multiple files and directories into a single archive for easy transfer, backup or distribution.

The basic syntax of the tar command is as follows:
tar [选项] [归档文件] [文件/目录...]
Here are some commonly used tar command options:
-c:创建一个新的归档文件。
-x:从归档文件中提取文件。
-f:指定归档文件的名称。
-v:显示详细信息,即在执行操作时输出被处理的文件名。
-z:使用gzip进行压缩或解压缩。
-j:使用bzip2进行压缩或解压缩。
-t:列出归档文件中包含的文件。
-r:向归档文件中追加文件或目录。
-u:仅向归档文件中追加比归档文件中相同路径的文件更新的文件。
-C:切换到指定

Guess you like

Origin blog.csdn.net/hyrylt/article/details/131102228