📅  最后修改于: 2023-12-03 14:48:13.790000             🧑  作者: Mango
Untar is a command-line utility in Linux and Unix-like operating systems used to extract files from a tar archive. The tar archive combines multiple files into a single file, and the untar command is used to extract those files.
The syntax for using the untar command is as follows:
tar -xf archive_name.tar
The following are some of the options that can be used with the untar command:
To extract files from an existing tar archive, run the following command:
tar -xf archive_name.tar
To create a new tar archive, run the following command:
tar -cf archive_name.tar file1 file2 file3
To extract a specific file from an archive, run the following command:
tar -xf archive_name.tar file_to_extract
To extract a compressed archive, use the appropriate option with the untar command.
For a gzip compressed archive, run the following command:
tar -xzf archive_name.tar.gz
For a bzip2 compressed archive, run the following command:
tar -xjf archive_name.tar.bz2
The untar command is an essential utility for working with tar archives in Linux and Unix-like operating systems. It provides a simple and efficient way to extract files from an archive, create new archives, and work with compressed archives.